BeOpBidAdapter: Refacto beopid cookie to caudid#14584
BeOpBidAdapter: Refacto beopid cookie to caudid#14584sebrobert wants to merge 3 commits intoprebid:masterfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 768da7a76b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
modules/beopBidAdapter.js
Outdated
| * @return {string} | ||
| */ | ||
| function generateObjectId() { | ||
| const timestamp = (Math.floor(Date.now() / 1000)).toString(16); |
There was a problem hiding this comment.
Zero-pad ObjectId timestamp to keep 24-char caudid
generateObjectId() uses (Math.floor(Date.now() / 1000)).toString(16) without padding, so when a client clock is set far in the past (or Date is mocked), the timestamp can be fewer than 8 hex chars and fg becomes shorter than 24 chars. That invalid value is still sent and written to caudid, which then fails your own ^[0-9a-fA-F]{24}$ check on every request and causes unstable user identity; padding the timestamp to 8 hex chars avoids this.
Useful? React with 👍 / 👎.
Pull Request Test Coverage Report for Build 23002110154Details
💛 - Coveralls |
Type of change
Description of change
beopidbecame an obsolet cookie. We managed the update tocaudidwhich is an ObjectId into our system, instead of the UUID before for thebeopid