-
Notifications
You must be signed in to change notification settings - Fork 79
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
Insert more than one domain #6
Comments
Actually, after reading a bit more, the right solution would be defining a list of allowed domains, and then check the ORIGIN header field for the font resource request. If it belongs to the list of allowed domains, then fill the Access-Control-Allow-Origin field with the respective domain and ship the response. |
I got a temporary work around working. Basically I rewrote some of the logic of the middleware in an intializer:
It is not optimal, but it does the trick now. But instead of assigning a domain in application.rb, I have to assign an array of domains. I've noticed that the set_headers! function takes the body parameter needlessly. I'll try to work on this a bit more, but tell me what you think meanwhile. |
This is the right approach but has one issue with cloundfront as they don't support the |
Hi man,
Great gem you got there. I'm just missing something: What if I want to had more than one domain? Thing is, the way the Access-Control-Allow-Origin header field should work, the field has to be repeated in the header:
Access-Control-Allow-Origin: http://example.com
Access-Control-Allow-Origin. https://example.com
At least that's what I read, comma separation doesn't work in this case.
Regards,
Tiago
The text was updated successfully, but these errors were encountered: