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

Upgrading to 3.6.1 causes HTTP 431 errors on POST requests #5751

Closed
SRocha147 opened this issue Nov 20, 2019 · 1 comment
Closed

Upgrading to 3.6.1 causes HTTP 431 errors on POST requests #5751

SRocha147 opened this issue Nov 20, 2019 · 1 comment
Labels
type: duplicate This issue or pull request already exists

Comments

@SRocha147
Copy link

Current behavior:

After upgrading from Cypress 3.4.1 to 3.6.1, we've been getting an HTTP 431 error. Here are the headers in my failing POST request:

Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
authorization: <...>
Content-Length: 171
content-type: application/json
Cookie: ai_user=y/J6x|2019-11-19T19:49:43.565Z; ai_session=DbTFk|1574192984304|1574192998997.615
Host: localhost:444
Origin: http://localhost:444
Proxy-Connection: keep-alive
Referer: http://localhost:444/test
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
X-Cypress-Delay: 0
X-Cypress-Headers: %7B%7D
X-Cypress-Id: xhr77
X-Cypress-Matched: **/MyClass/**
X-Cypress-Response: %7B%7D
X-Cypress-Status: 200

Desired behavior:

Should not fail.

Steps to reproduce: (app code and test code):

Make a POST request with the above header in Cypress.

    cy.server();
    cy.route({
      method: 'POST',
      url: '**/MyClass/**',
      status: 200,
      response: {},
    });

Versions:

Chrome 78
Cypress 3.6.1

We run the tests via npm run test:cypress.

For now we have reverted to 3.4.0 until this issue is resolved in later versions. I saw that in 3.6.0, Cypress fixed an issue related to the 431 issue:

We fixed a regression in 3.5.0 where the maximum size of an HTTP header or body in a stubbed cy.route() was limited to 8kb causing requests to fail with a 431 HTTP error. Fixes #5431.

It's possible this code was revisited and caused another regression in 3.6.1

Cypress now sends the expected headers or request body in a cy.visit() to an HTTPS URL using the default port, 443. Fixes #5367

@flotwig
Copy link
Contributor

flotwig commented Nov 20, 2019

@SRocha147 thanks for reporting this, I believe this is a duplicate of #5561, so closing this for now. If this is a mistake please reopen.

@flotwig flotwig added the type: duplicate This issue or pull request already exists label Nov 20, 2019
@flotwig flotwig closed this as completed Nov 21, 2019
@cypress-io cypress-io locked and limited conversation to collaborators Jan 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants