camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Netherton (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-10985) camel-coap fails to return results when enableCORS(true) is set
Date Mon, 24 Apr 2017 16:26:04 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-10985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15981454#comment-15981454
] 

James Netherton commented on CAMEL-10985:
-----------------------------------------

I'm no expert on CoAP, but, does CORS even make sense in this context? See method codes listed
in this document (OPTIONS is not mentioned):

https://github.com/markushx/coap-cheatsheet/blob/master/coap-cheatsheet.pdf

The reason things are not working, is because when CORS is enabled, camel is [automatically
adding|https://github.com/apache/camel/blob/master/components/camel-coap/src/main/java/org/apache/camel/coap/CoAPComponent.java#L119-L121]
{{OPTIONS}} to the list of allowed method verbs configured on the endpoint. This screws up
the logic to retrieve the correct consumer to handle the request, since it's expecting to
match against individual verb names like {{GET}} or {{POST}} etc. Not {{GET,OPTIONS}} or {{POST,OPTIONS}}
etc.



> camel-coap fails to return results when enableCORS(true) is set
> ---------------------------------------------------------------
>
>                 Key: CAMEL-10985
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10985
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-coap
>    Affects Versions: 2.19.0
>            Reporter: Scott Cranton
>            Priority: Minor
>
> In the CoAPRestVerbTest, if you add to the restConfiguration() .enableCORS(true), then
all of the unit tests that return a result fail as no response is returned
> https://github.com/apache/camel/blob/master/components/camel-coap/src/test/java/org/apache/camel/coap/CoAPRestVerbTest.java#L106



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message