You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Ralf Steppacher (JIRA)" <ji...@apache.org> on 2016/04/11 16:28:25 UTC

[jira] [Updated] (CAMEL-9855) REST DSL rest configuration attribute enableCORS has no effect when rendering resource listing/Camel contexts

     [ https://issues.apache.org/jira/browse/CAMEL-9855?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ralf Steppacher updated CAMEL-9855:
-----------------------------------
    Description: 
Setting the attribute {{enableCORS}} to true has no effect, i.e. none of the {{Access-Control-*}} are set. To enable CORS headers one has to add an {{apiProperty}} element like so:

{code:xml}
<restConfiguration contextPath="{{contextpath}}" component="jetty" scheme="http" host="{{host}}" port="{{port}}" apiContextPath="api-docs">
   <apiProperty key="cors" value="true" />
   <!-- ... -->
/>
</restConfiguration>
{code}

See {{RestSwaggerSupport::renderCamelContexts(...)}} and {{RestSwaggerSupport::renderResourceListing(...)}}.

{{RestSwaggerSupport}} adds the headers with capital first letters: {{Access-Control-Allow-Origin}}. However, the response contains the header names all lower case. Not sure where they loose the capitalization. 

  was:
Setting the attribute {{enableCORS}} to true has no effect, i.e. none of the {{Access-Control-*}} are set. To enable CORS headers one has to add an {{apiProperty}} element like so:

{code:xml}
<restConfiguration contextPath="{{contextpath}}" component="jetty" scheme="http" host="{{host}}" port="{{port}}" apiContextPath="api-docs">
   <apiProperty key="cors" value="true" />
   <!-- ... -->
/>
</restConfiguration>
{code}

See {{RestSwaggerSupport::renderCamelContexts(...)}} and {{RestSwaggerSupport::renderResourceListing(...)}}.

{{RestSwaggerSupport}} adds the headers in with capital first letters: {{Access-Control-Allow-Origin}}. However, the response contains the header names all lower case. Not sure where they loose the capitalization. 


> REST DSL rest configuration attribute enableCORS has no effect when rendering resource listing/Camel contexts
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-9855
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9855
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.16.3
>         Environment: Karaf 4.0.3, Java 8, Blueprint
>            Reporter: Ralf Steppacher
>            Priority: Minor
>
> Setting the attribute {{enableCORS}} to true has no effect, i.e. none of the {{Access-Control-*}} are set. To enable CORS headers one has to add an {{apiProperty}} element like so:
> {code:xml}
> <restConfiguration contextPath="{{contextpath}}" component="jetty" scheme="http" host="{{host}}" port="{{port}}" apiContextPath="api-docs">
>    <apiProperty key="cors" value="true" />
>    <!-- ... -->
> />
> </restConfiguration>
> {code}
> See {{RestSwaggerSupport::renderCamelContexts(...)}} and {{RestSwaggerSupport::renderResourceListing(...)}}.
> {{RestSwaggerSupport}} adds the headers with capital first letters: {{Access-Control-Allow-Origin}}. However, the response contains the header names all lower case. Not sure where they loose the capitalization. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)