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

Ensure that deflate/brotli is filtered out in Accept Encoding by the Cypress proxy #28025

Closed
ryanthemanuel opened this issue Oct 10, 2023 · 2 comments · Fixed by #28026
Closed
Assignees

Comments

@ryanthemanuel
Copy link
Collaborator

ryanthemanuel commented Oct 10, 2023

Currently, Cypress tries to filter down Accept-Encoding headers to just gzip. This works when the header is present, but when it is blank according to the standards for the header:

If no Accept-Encoding header field is in the request, any content coding is considered acceptable by the user agent.

Thus, we need to update the logic to specify identity when there is no Accept Encoding header.

The problem would manifest itself in the following scenario:

  1. No Accept-Encoding header is sent on a request
  2. The server sends back the response encoded in an unsupported encoding (e.g. brotli/deflate)
  3. Something in Cypress relies on the decompressed body (this could include cy.intercept or CSS, font, and image assets in Test Replay)
@ryanthemanuel ryanthemanuel self-assigned this Oct 10, 2023
@ryanthemanuel ryanthemanuel changed the title Ensure that brotli is filtered out in Accept Encoding by the Cypress proxy Ensure that deflate/brotli is filtered out in Accept Encoding by the Cypress proxy Oct 10, 2023
@csvan
Copy link

csvan commented Oct 11, 2023

Wouldn't a more scalable solution be to just support brotli? This encryption is extremely common on the modern web, and Cypress insisting on Gzip actually leads to compression issues when e.g. talking to CloudFront endpoints.

#6197

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 18, 2023

Released in 13.3.2.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Oct 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants