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

Cypress 9.1 appears to mishandle POST content with special characters #19084

Closed
davymitchell opened this issue Nov 24, 2021 · 8 comments · Fixed by #19239
Closed

Cypress 9.1 appears to mishandle POST content with special characters #19084

davymitchell opened this issue Nov 24, 2021 · 8 comments · Fixed by #19239
Labels
topic: network type: bug type: regression A bug that didn't appear until a specific Cy version release v9.1.0 🐛 Issue present since 9.1

Comments

@davymitchell
Copy link

davymitchell commented Nov 24, 2021

Current behavior

Upgraded from 9.0 to 9.1

Multiple Tests that send a POST including random generated password content with blackslashes:

e.g. "oldPassword":"S.]\x7e}gZ3=kFJ" (Note the double backslash - GH editor might hide this!).

Fails at when received at the server as oldPassword is wrong.

Desired behavior

Tests execute POST commands as before.

Test code to reproduce

-UPDATED-
Analysis as in comment below from slavab89 appears to be what I am observing.

Cypress Version

9.1.0

Other

Thank you. 😄

@slavab89
Copy link

Can confirm this.
In the logs and when inspecting a command, it shows the correct char. For example ~, but when receiving this on the server side it shows as \x7e which is the hex value

@pazernh
Copy link

pazernh commented Nov 29, 2021

What is strange in my request when I have ~two times in a string, only first one is changed to %5Cx7e second one stays as ~

@chrisbreiding
Copy link
Contributor

Do you have a reproducible example of this? What app code or test code is running to evidence this?

@pazernh
Copy link

pazernh commented Dec 2, 2021

I am sending request to authenticate with cy.request and I have ~ in my client secret randomly generated in azure portal and Cypress is trying to encode while creating url for POST

@duck1123
Copy link

duck1123 commented Dec 2, 2021

In my case, I'm seeing it when I try to intercept a request and respond with json data (using req.reply) that contains a ~ character.

I haven't been able to get a reproducible example together yet.

@LoaderB0T
Copy link

Hi @chrisbreiding , hi @duck1123
I have basically the same issue and created a very simple repro repo. Different use case but the same origin of error, I'm sure. Linked in this issue: #19178

@cypress-bot cypress-bot bot added the stage: needs review The PR code is done & tested, needs review label Dec 3, 2021
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Dec 3, 2021
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 3, 2021

The code for this is done in cypress-io/cypress#19239, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 4, 2021

Released in 9.1.1.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Dec 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic: network type: bug type: regression A bug that didn't appear until a specific Cy version release v9.1.0 🐛 Issue present since 9.1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants