-
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
API call changes method on 308 redirect #28058
Comments
It looks like @cypress/request implements and tests HTTP RFC 9110 - HTTP Semantics, obsoletes RFC 7538 - The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect, and includes 15.4.9 - HTTP 308 (Permanent Redirect) to describe. |
Do you have a public URL available which responds with HTTP |
It looks like this issue also affects current versions. The report could be improved to provide an up-to-date reference to the issue:
|
I reproduced this issue with Cypress RFC 9110 - 15.4 Redirection 3xx states:
Steps to reproduceA repro of this non-conformance issue is posted to cypress-test-tiny including a README to describe the issue and steps to reproduce. |
Thanks @MikeMcC399, |
Thanks for your update. I tried adding your code: .its("body").should("eq", "POST" to my test, however I used serve for the test because it easily allows setting up a redirect and it conveniently logs all requests, so I think this is sufficient to demonstrate the problem, since the logs clearly show POST followed by the incorrect GET. I'm not expecting this to get fixed soon, as RFC 9110 - 15.4.9 HTTP 308 (Permanent Redirect) includes the text:
cypress-io/request#35 (comment) stated that the Cypress team wanted to move away from using |
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided. |
The issue is still reproducible with Cypress git clone --branch RFC-9110 https://github.com/MikeMcC399/cypress-test-tiny
cd cypress-test-tiny
npm ci
npm test The log of the test still shows
|
@MikeMcC399 We will have to move off of cypress/request , so it could be resolved when we do that work. But that work isn't currently planned. |
Understood |
repro updated to latest versions |
Current behavior
When calling a POST API endpoint that is redirected by a 308 to another path, cypress changes the method to GET. This is not allowed since RFC 7538.
Desired behavior
Redirect without changing the method when encountering a 307 or 308 redirect.
Test code to reproduce
Cypress Version
13.3.2
Node version
v18.18.2
Operating System
Windows 10.0.19045.3570
Debug Logs
Steps to reproduce
You can find the code to reproduce the issue here: https://github.com/julianklose/cypress-308-test
The text was updated successfully, but these errors were encountered: