[CONTROLLER-537] Cross domian issue with Restconf API explorer (/apidoc/apis/) - need to add CORS header to server Created: 05/Jun/14  Updated: 25/Jul/23  Resolved: 11/Jul/14

Status: Resolved
Project: controller
Component/s: restconf
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Juraj Sebin Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: PC


Attachments: File cors-config.xml    
Issue Links:
Blocks
is blocked by CONTROLLER-451 Remove cors filter from application b... Resolved
External issue ID: 1139

 Description   

There is Cross-domain issue when querying Restconf API explorer (https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf_API_Explorer wiki, https://git.opendaylight.org/gerrit/#/c/6574/ gerrit) from javascript.

No 'Access-Control-Allow-Origin' header is present on the requested resource.

From what it seems CORS headers need to be set on server. We would like to have access to apidoc/apis/ API from javascript to dynamically discover APIs for each module, but we can't continue until this issue is fixed.

p.s.: when calling /restconf/modules/ there is no such issue



 Comments   
Comment by Tomas Olvecky [ 10/Jul/14 ]

Please look at
configuration/cors-config.xml
and
https://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#CORS_Filter

If you need to expose this header, add it to cors.exposed.headers

Comment by Juraj Sebin [ 10/Jul/14 ]

attaching updated cors-config.xml with headers for apidoc/ path

Comment by Juraj Sebin [ 10/Jul/14 ]

Attachment cors-config.xml has been added with description: updated cors-config.xml for apidoc/ path

Comment by Tomas Olvecky [ 10/Jul/14 ]

https://git.opendaylight.org/gerrit/8895

Generated at Wed Feb 07 19:53:16 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.