-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Fix CDP cookie matching algorithm #5862
Conversation
Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.
PR Review ChecklistIf any of the following requirements can't be met, leave a comment in the review selecting 'Request changes', otherwise 'Approve'. User Experience
Functionality
Maintainability
Quality
Internal
|
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
@@ -18,18 +17,29 @@ interface CyCookie { | |||
httpOnly: boolean | |||
} | |||
|
|||
// Cypress uses the webextension-style filtering | |||
// https://developer.chrome.com/extensions/cookies#method-getAll | |||
type CyCookieFilter = chrome.cookies.GetAllDetails |
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.
why not import the chrome
types at the top vs putting them in the compilerOptions
? I feel like this comes out of nowhere
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.
if i do import 'chrome'
, build fails
if i do import chrome from 'chrome'
, it says 'chrome' is not a module
i can dig into why import 'chrome'
makes the build fail if you'd like, i'm not sure this is the best way either
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.
ask @tgriesser in #typescript channel
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.
nvm he's on his way to the airport - @tgriesser or @thlorenz can you explain why this is necessary whenever you have time?
* use correct tough.match param order * add chrome extension types * fix CDP cookie matching algorithm * improve domain suffix match * add tests for cookie matching utils
User facing changelog
Fixed a bug where cy.getCookie would incorrectly filter cookies by their domain, leading to unexpected results.
Additional details
tough.cookieMatch
to filter cookies:cypress/packages/server/lib/browsers/cdp_automation.ts
Lines 23 to 37 in d56c551
domain
like this: "Restricts the retrieved cookies to those whose domains match or are subdomains of this one."How has the user experience changed?
PR Tasks