1

I want to let my project's JS/CSS requested by other domains for bookmarklet use, but I got an Access-Control-Allow-Origin error.

Have searched parse.com Access-Control-Allow-Origin keywords. Nothing helpful. Wish there's a way to make it...

user3332315
  • 141
  • 4

1 Answers1

0

Your server would read the Origin header that comes from the client, check against a list of accepted domains and then include that domain in a Access-Control-Allow-Origin header in the response.

According to the specs:

The Access-Control-Allow-Origin header indicates whether a resource can be shared based by returning the value of the Origin request header, "*", or "null" in the response. ABNF:

Access-Control-Allow-Origin = "Access-Control-Allow-Origin" ":" origin-list-or-null | "*"

Here is more information:

https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS

Max Worg
  • 2,932
  • 2
  • 20
  • 35