question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable CORS for API v3

See original GitHub issue

Currently 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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
maartenbacommented, May 18, 2016

No promises, but definitely before 2020 😉 Kidding, should be fairly quick!

1reaction
maartenbacommented, May 18, 2016

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found