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

Update typing CyHttpMessages.BaseMessage.headers #16734

Closed
andercs opened this issue May 28, 2021 · 3 comments · Fixed by #16765
Closed

Update typing CyHttpMessages.BaseMessage.headers #16734

andercs opened this issue May 28, 2021 · 3 comments · Fixed by #16765
Assignees
Labels
type: typings Issue related to Cypress types (for TypeScript)

Comments

@andercs
Copy link
Contributor

andercs commented May 28, 2021

What would you like?

This should be fairly straightforward, but the headers dictionary field in CyHttpMessages.BaseMessage within packages/net-stubbing/lib/external-types.ts can be expanded to include string[] as a valid value type (in addition to just string).

An example of when this might occur is when the server returns a set-cookie header that includes multiple cookies. This results in a value of string[] where each cookie is its own string.

Why is this needed?

This improves typing in IDEs/Editors and also prevents TS2339 wherein calling .filter on headers is flagged as problematic when it is not.

@jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane added type: typings Issue related to Cypress types (for TypeScript) stage: ready for work The issue is reproducible and in scope labels Jun 1, 2021
@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: ready for work The issue is reproducible and in scope stage: work in progress stage: needs review The PR code is done & tested, needs review labels Jun 1, 2021
andercs added a commit to andercs/cypress that referenced this issue Jun 8, 2021
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: waiting labels Jun 9, 2021
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 9, 2021

The code for this is done in cypress-io/cypress#16765, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Jun 9, 2021
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 23, 2021

Released in 7.6.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v7.6.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jun 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: typings Issue related to Cypress types (for TypeScript)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants