[
https://issues.apache.org/jira/browse/CAMEL-9270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15031761#comment-15031761
]
Anton Koscejev commented on CAMEL-9270:
---------------------------------------
[~davsclaus], current fix is flawed (details below). I have a solution that I
can provide a PR - should I create a new issue or reopen this one?
I found this out while trying to implement CAMEL-9371, which should've been a
tiny fix. Restlet rejects headers that are not trimmed, and there's a small bug
where Access-Control-Expose-Headers is actually treated as a Set of Method. The
result is that Restlet's internal StringWriter fails with
IllegalArgumentException at HeaderWriter.java:286 (because header is not
trimmed and space is not allowed), and this results in HTTP status code being
500 instead of 200 with no details regarding what happened (pretty bad restlet
behavior, btw).
> rest-dsl - CORS support doesn't work with Restlet 2.3
> -----------------------------------------------------
>
> Key: CAMEL-9270
> URL: https://issues.apache.org/jira/browse/CAMEL-9270
> Project: Camel
> Issue Type: Bug
> Components: camel-restlet
> Affects Versions: 2.16.0
> Reporter: Anton Koscejev
> Assignee: Claus Ibsen
> Fix For: 2.16.2, 2.17.0
>
>
> camel-restlet has upgraded to Restlet 2.3 (nice!), but this broke rest-dsl
> CORS support, because Restlet 2.3 no longer supports setting CORS headers via
> attributes. There are now API methods for these headers and attributes are
> ignored with a warning.
> Example of the new API method:
> http://restlet.com/technical-resources/restlet-framework/javadocs/2.3/jse/api/org/restlet/Response.html#setAccessControlAllowOrigin%28java.lang.String%29
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)