Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

additional enable for cross-origin from angular client app #36

Open
balmas opened this issue Feb 13, 2015 · 0 comments
Open

additional enable for cross-origin from angular client app #36

balmas opened this issue Feb 13, 2015 · 0 comments

Comments

@balmas
Copy link
Collaborator

balmas commented Feb 13, 2015

it would be handy to enable imgcollect (or other angular client app) to be able to make cross-origin requests to JackSON.

I found the following code, per this post, http://benjaminhorn.io/code/setting-cors-cross-origin-resource-sharing-on-apache-with-correct-response-headers-allowing-everything-through/, to do the trick:

`set :allow_methods, [:get, :post, :options]

options "*" do
response.headers["Allow"] = "HEAD,GET,PUT,DELETE,OPTIONS"

Needed for AngularJS

response.headers["Access-Control-Allow-Headers"] = "X-Requested-With, X-HTTP-Method-Override, Content-Type, Cache-Control, Accept"

halt 200
end
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant