-
Notifications
You must be signed in to change notification settings - Fork 50
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
CORS with header sendback #55
Comments
In particular, if the origin contains a port specification (e.g. |
In case you haven't seen the doc: https://github.com/s1n4/leptus/blob/master/docs/callbacks.org#cross_domains3 Could you pass Like this:
|
Aha. |
That should be the atom |
OK running with:
Here is a curl that does not specify a port:
This works as intended and shows the header But when we do:
it blows up |
Right now this is a REST service exposed to clients, so I will have to make some code changes to allow logs to penetrate through. Right now there are no logs that would be useful to you |
Maybe this is a Cowboy issue, because it is blowing up but I don't see any Leptus logs. Code:
Working one without port:
Erlang console displays
One with port that blows up:
Erlang consule displays
|
Is cowboy's E.g., other people have solved this by directly setting headers like:
from: ninenines/cowboy#947 |
Someone forked Leptus and the first two commits I see is titled "fixed cors origin port issue" and "added new cors headers" https://git.teknorota.com/yekmyk/leptus Not sure if that yields any hints.. |
The same issue here. @sinasamavati do you have thoughts on this? |
I have followed this: #33
This correctly returns the origin.
However, how do you enable CORS support that depends on the Port too? I.e., how do you configure Leptus to return the header
Access-Control-Allow-Origin: *
? We have another service making ajax calls that is expecting that header, which seems to fail when only origin is returned without a port.The text was updated successfully, but these errors were encountered: