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

/setuid endpoint does not set 'uids' cookie when both GDPR and GPP is set in the request #3166

Closed
ashishshinde-pubm opened this issue Sep 29, 2023 · 2 comments

Comments

@ashishshinde-pubm
Copy link
Contributor

ashishshinde-pubm commented Sep 29, 2023

Following endpoint returns incorrect response and response-header when both gdpr and gpp parameters are passed in the request.
Request

curl -I --location --request GET 'http://localhost:8001/setuid?bidder=pubmatic&uid=123&gpp_sid=1,2&gpp=DBABMA~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA&gdpr=1&gdpr_consent=BONciguONcjGKADACHENAOLS1rAHDAFAAEAASABQAMwAeACEAFw'

Response-Body

Warning: 'gpp' value will be used over the one found in the deprecated 'gdpr_consent' field.

Response-Header

HTTP/1.1 200 OK
Date: --------
Content-Length: 92
Content-Type: text/plain; charset=utf-8

As per the test case description , if both GPP and GDPR are passed in the request then we should give priority to GPP and throw warning.
However, the actual code calls the 'Write' method on response-writer first and then writes warning on same response-writer (here) if responseFormat "f" is set to "i"

Also, here we are trying to call WriteHeader function after write method code which is not correct/recommended.

Possible Fix

  1. I think we should not throw the warning in response body. If it is required then we can throw warning in response header instead of response body.
  2. Do not allow to proceed if both GDPR and GPP are set and return from here

@guscarreon Can you please check if this is valid bug.

@bretg
Copy link
Contributor

bretg commented Dec 1, 2023

PR #3165

@SyntaxNode
Copy link
Contributor

Implemented in PBS-Go 2.2

@github-project-automation github-project-automation bot moved this from In Progress to Done in Prebid Server Prioritization Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants