-
Notifications
You must be signed in to change notification settings - Fork 764
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 policy for https://prebid.adnxs.com/pbs/v1/cookie_sync #1198
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change itself should be good. Was there testing that this header was not being set to "*", or is that just a guess at the root cause?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should close this PR. The proposed fix will break cookie sync in pretty much every browser.
@@ -304,6 +304,7 @@ func SupportCORS(handler http.Handler) http.Handler { | |||
AllowOriginFunc: func(string) bool { | |||
return true | |||
}, | |||
AllowedOrigins: []string{"*"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually can't do this. It will break in browsers. See: rs/cors#55
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't do this based on Scott's findings.
This PR would cause browsers to block the cookie sync endpoint responses via CORS. |
A lot of errors related to publisher integrations have been reported because the apparent lack of the
Access-Control-Allow-Origin
CORS header that is basically a whitelist of the URLs where clients allow to pull content from other source than the origin. In golang's Go CORS handler library, not specifying any value inside theAllowedOrigins
array of theOptions
field, should default to a"*"
value which, according to thehttps://github.com/rs/cors
documentation, should suffice to make the headerAccess-Control-Allow-Origin
default to"*"
. This pull request will explicitly set theAccess-Control-Allow-Origin
to an"*"
value in order to avoid anyNo 'Access-Control-Allow-Origin' header is present on the requested source
errors on the client side.BEFORE:
AFTER
Difference: