Skip to content

Update typing CyHttpMessages.BaseMessage.headers #16734

@andercs

Description

@andercs

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.

Metadata

Metadata

Assignees

Labels

type: typingsIssue related to Cypress types (for TypeScript)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions