-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Intercept resets compatible content type when body is an object #17084
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
Comments
Sorry for the late reply. I tested it by copying and pasting it. But found out that |
The code for this is done in cypress-io/cypress#17199, but has yet to be released. |
Reverted, see #17401 |
The code for this is done in cypress-io/cypress#17401, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
The following test passes:
Desired behavior
.intercept()
should not overwrite the content type if I explicitly provide one. Especially if my content type matches the response body.Or, in other words. The following test should pass:
The test
Test code to reproduce
As above :)
I also have a random server up at
http://localhost:3000
. Since we're replacing the response of the server anyway, it really doesn't matter what's running there. My server is an Express Hello World :)Versions
Cypress: 7.5.0
Workaround
I already found a workaround. I'll share it in case it helps someone else.
This only happens when your response body is an object, so all you have to do is stringify it like so:
The text was updated successfully, but these errors were encountered: