-
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
feat: support host only cookies #25853
Changes from all commits
aff476b
33a3829
46ac6bc
e3da54a
0369c62
2f48612
f940632
41ce402
e47f631
4424d45
de7de04
b53154c
5f03c29
5d4b48d
b3c1585
5efe56d
749e731
c3b9b3f
daf0936
ae4d0b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,7 @@ import Promise from 'bluebird' | |
import $utils from '../../cypress/utils' | ||
import $errUtils from '../../cypress/error_utils' | ||
|
||
// TODO: add hostOnly to COOKIE_PROPS | ||
// https://github.com/cypress-io/cypress/issues/363 | ||
// https://github.com/cypress-io/cypress/issues/17527 | ||
const COOKIE_PROPS = 'name value path secure httpOnly expiry domain sameSite'.split(' ') | ||
const COOKIE_PROPS = 'name value path secure hostOnly httpOnly expiry domain sameSite'.split(' ') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! I got the documentation up to date in cypress-io/cypress-documentation#5071 to add the cookie option return types. I added the types to cookie options in 19c0663 and removed the links. I don't think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Funny our types already included hostOnly There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a bit of a blur at this point because in some cases it might be in the automation client, but it shouldnt be in client types yet I don't think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe Im reading this wrong? Cookie type which is returned here https://github.com/cypress-io/cypress/blob/feat/support-host-only-cookies/cli/types/cypress.d.ts#L1433 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I may have added that. I rebased this branch quite a bit and the changeset distinction might have got lost between rebases. |
||
|
||
function pickCookieProps (cookie) { | ||
if (!cookie) return cookie | ||
|
@@ -359,6 +356,7 @@ export default function (Commands, Cypress: InternalCypress.Cypress, cy, state, | |
path: '/', | ||
secure: false, | ||
httpOnly: false, | ||
hostOnly: false, | ||
log: true, | ||
expiry: $utils.addTwentyYears(), | ||
}) | ||
|
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 we add descriptions for typescript to render for users?
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.
added in 58851a5. Is this what you are referring to?
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.
I'd expect each property to be documented, so some of this is back-fill work 😬
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.
Wouldn't be we better off pointing them to the docs in the comment, which will have a more easily readable description for each property?
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.
I assume no because users want to see it inline when typing their options not clicking to the docs? I don't really leverage typescript annotations but I assume thats why people want them, everything upfront while coding.
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.
I think thats fair, especially since we do it for other types. I added them in b3c1585. Let me know what you think!