Skip to content

INTER-2335: Upgrade cookie dependency to v2 - #258

Merged
erayaydin merged 3 commits into
mainfrom
chore/upgrade-cookie-v2-inter-2335
Jul 30, 2026
Merged

INTER-2335: Upgrade cookie dependency to v2#258
erayaydin merged 3 commits into
mainfrom
chore/upgrade-cookie-v2-inter-2335

Conversation

@erayaydin

Copy link
Copy Markdown
Member

Summary

  • Upgrade cookie from 1.1.1 to 2.0.1.
  • Use the new parseCookie function.

Customer impact

None. Cookie parsing is used internally to filter the _iidt cookie from request headers before proxying to the Fingerprint API.

Benefits

  • ~22% smaller bundle size (25.41 kB -> 19.80 kB)

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 99.63% 267/268
🟢 Branches 99.13% 114/115
🟢 Functions 100% 58/58
🟢 Lines 99.62% 262/263

Test suite run success

286 tests passing in 95 suites.

Report generated by 🧪jest coverage report action from 421d617

Show full coverage report
St File % Stmts % Branch % Funcs % Lines Uncovered Line #s
🟢 All files 99.62 99.13 100 99.61
🟢  src 100 100 100 100
🟢   config.ts 100 100 100 100
🟢   env.ts 100 100 100 100
🟢   handler.ts 100 100 100 100
🟢   index.ts 100 100 100 100
🟢  src/handlers 98.7 96.15 100 98.66
🟢   ...ApiRequest.ts 96.42 87.5 100 96.15 79
🟢   ...StatusPage.ts 100 100 100 100
🟢  src/utils 100 100 100 100
🟢   ...ionHeaders.ts 100 100 100 100
🟢   ...Monitoring.ts 100 100 100 100
🟢   cookie.ts 100 100 100 100
🟢   ...orResponse.ts 100 100 100 100
🟢   ...WithMaxAge.ts 100 100 100 100
🟢   ...AgeIfLower.ts 100 100 100 100
🟢   proxyEndpoint.ts 100 100 100 100
🟢   ...tpResponse.ts 100 100 100 100
🟢   routing.ts 100 100 100 100

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades the cookie dependency to v2 and adapts the internal cookie-filtering utility to the new parsing API, keeping request header filtering behavior in place before proxying to the Fingerprint API.

Changes:

  • Bump cookie dependency from 1.1.1 to 2.0.1.
  • Switch cookie parsing usage from parse to parseCookie in the header filtering helper.
  • Update lockfile entries to reflect the new dependency version.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/utils/cookie.ts Updates the cookie parsing callsite to use parseCookie while preserving the existing filtering logic.
package.json Bumps the cookie dependency to 2.0.1.
pnpm-lock.yaml Records the updated cookie@2.0.1 resolution and snapshot entries.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@erayaydin
erayaydin force-pushed the chore/upgrade-cookie-v2-inter-2335 branch from 91aa955 to e8a10bb Compare July 23, 2026 20:02
@erayaydin
erayaydin marked this pull request as ready for review July 23, 2026 20:03
Upgrade the `cookie` package from `1.1.1` to `2.0.1`.

Related-Task: INTER-2335
@erayaydin
erayaydin force-pushed the chore/upgrade-cookie-v2-inter-2335 branch from e8a10bb to 88bba44 Compare July 24, 2026 08:39
TheUnderScorer
TheUnderScorer previously approved these changes Jul 24, 2026

@TheUnderScorer TheUnderScorer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, left one comment/suggestion, thanks!

Comment thread .changeset/upgrade-cookie-v2.md
Comment thread package.json
Base automatically changed from chore/update-dependencies-inter-2335 to main July 29, 2026 14:28
@erayaydin
erayaydin dismissed TheUnderScorer’s stale review July 29, 2026 14:28

The base branch was changed.

necipallef
necipallef previously approved these changes Jul 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Following releases will be created using changesets from this PR:

@fingerprint/cloudflare-worker-proxy@1.7.1

Patch Changes

  • Upgrade cookie dependency from v1 to v2. ~22% smaller bundle size. No customer-facing changes. (88bba44)

@erayaydin
erayaydin requested a review from necipallef July 29, 2026 17:02

@mcnulty-fp mcnulty-fp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

FWIW, in the Flow worker, we created our implementation of cookie header field parsing, based on jshttp/cookie, that handles multiple cookies with the same name correctly. Might be worth considering if the cloudflare worker should follow suit at some point. Further details are in this PR discussion.

@erayaydin
erayaydin merged commit 50e03da into main Jul 30, 2026
35 of 41 checks passed
@erayaydin
erayaydin deleted the chore/upgrade-cookie-v2-inter-2335 branch July 30, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants