-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 Problems #7840
Comments
Those are mainly limitation/bug in the module: https://github.com/go-macaron/cors For On side-note: We maybe should clean some configuration and replace hsts and cors specific case via configuration like suggested here: #7423 (comment) |
1 . & 2 . I understand, that 4 . Thanks for clearing that 3 . is somewhat confusing as go-macaron src code explicitly states HTTP- |
@sapk we have forked almost all macaron repositories to https://gitea.com/macaron. Please send PR to there and I think we could replace macaron with our forks on v1.10 |
1 . & 2. are taken care of in https://gitea.com/macaron/cors/pulls/3 |
@HoffmannP , I am the original author of the macaron cors module. I thought that the module already responding to preflight requests here: Isn't that enough? |
I think #7204 is related to 3. |
ah! So, currently CORS handler is only set on the I would argue that anything that is not an "api" should not have to deal with CORS since it is not meant to called via Ajax from external domains. So, is this login_oauth an api? Is this use-case trying to login via |
I am referring to this sections of the Oauth2 RFC. Implicit Grant can be used via Ajax. Authorization Code Grant should not be used from Ajax. |
I'm not talking about non-API-endpoints, I'm talking about the API. As I see it, the problem is 1. the |
Thanks @HoffmannP ! I am starting to see some of the issues but the fix is not clear to me.
This will need some rewiring. Right now the order is not correct. May be you can open a pr. I did not see this problem because in my case we were using cookie for auth and cookies are forwarded with cross site calls. |
https://github.com/go-macaron/macaron/blob/213788aac5bca04b4ef40b4b3ab821d417dbf396/macaron.go#L173
Macaron stops future process when it returns true. https://github.com/go-macaron/macaron/blob/master/macaron.go#L215 |
I looked into the macaron source code and this is what I found:
So, I see 2 fixes are needed;
PR: https://gitea.com/macaron/cors/pulls/5
For this I have opened #7967 @HoffmannP might want to try this branch and see if this fixes your issue. |
Description
Even after the 1.9-update I still have issues with CORS:
cors.ALLOW_DOMAIN
, setting it to '*' does not respond with the Origin-Domain but with*
(which is not allowed for auth-Requests).cors.SCHEMA
option doesn't seem to do anything (also, probably only allows one value)authorization
-header is omitted but querying the API even with anOPTIONS
request results in a403 Forbidden
repository.ACCESS_CONTROL_ALLOW_ORIGIN
doing?The text was updated successfully, but these errors were encountered: