Enable CORS for API v3
See original GitHub issueCurrently it is not possible to use the @id
property of the returned repo from e.g. this request:
https://api-v2v3search-0.nuget.org/query?q=id:Cinteros.Xrm.FetchXMLBuilder
The @id
property is returned as:
https://api.nuget.org/v3/registration0/cinteros.xrm.fetchxmlbuilder/index.json
Pasting it in a browser works fine, but trying with an ajax request returns parsererror Unexpected token :
(if trying as jsonp and crossDomain) or Access-Control-Allow-Origin
error otherwise.
I believe this could be fixed by enabling CORS for the returned API urls. (I appologize if my terminology is not 100%) Ref: #3036
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Enabling CORS for a REST API resource
Learn what cross-origin resource sharing (CORS) is, whether you want to enable it, and how to enable CORS methods in API Gateway.
Read more >Enable CORS on a resource using the API Gateway import ...
If you are using the API Gateway Import API, you can set up CORS support using an OpenAPI file. You must first define...
Read more >Enabling CORS support for an API
To enable CORS support for an API, complete the following steps: ... Select the Policies tab, expand Gateway and portal settings, then click...
Read more >CORS (3), Enable CORS In .NET Core Web API
This is an article following Consume Web API By MVC In .NET Core (3), to enable CORS to make an access from Cross...
Read more >Enabling CORS support for an API
You can enable cross-origin resource sharing (CORS) support for your API. CORS allows embedded scripts in a web page to call the API...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No promises, but definitely before 2020 😉 Kidding, should be fairly quick!
Looks like all we have to do is set our Azure blob storage CORS rules + add these headers to search service.
Minimal header:
Access-Control-Allow-Origin *
My vote would be to also add:Access-Control-Max-Age 3600
(so we can expire the CORS header with preflight, if needed)@yishaigalatzer would you be okay with adding this so that browsers can do cross-domain JavaScript requests to our V3 API?