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

A forward slash '/' is stripped from the query paramaters on the request #9360

Closed
rwindt opened this issue Nov 27, 2020 · 4 comments · Fixed by #9373
Closed

A forward slash '/' is stripped from the query paramaters on the request #9360

rwindt opened this issue Nov 27, 2020 · 4 comments · Fixed by #9373
Labels
type: unexpected behavior User expected result, but got another v5.4.0 🐛 Issue present since 5.4.0

Comments

@rwindt
Copy link

rwindt commented Nov 27, 2020

Current behavior

When using cy.request() for a path without a hostname the trailing / is deleted from the query parameters. In test we use, we have a baseUrl, and per test we add the path.

For example we have defined the baseUrl www.test.url(please use a working url, this is only used as an example) and in the test we have cy.request('/pageOne?param1=/param/') then the following is executed in Cypress request GET 200 http://www.test.url/pageOne?param1=/param. The last / is deleted. This test started to fail since the introduction of Cypress 5.4.0, I think it could be related to this issue #2101

Desired behavior

Desired behaviour is that the trailing / is not deleted from the given path.

Test code to reproduce

cy.request(`/pageOne?param1=/param/`)

Do have a baseUrl set.

Versions

Worked on 5.3.0
Started to fail from 5.4.0 onwards

@jennifer-shehane
Copy link
Member

To reproduce this doesn't require having a baseUrl set. This behavior change was introduced in 5.4.0 in #8630 cc @sainthkh

Issue present: b86b26e
Issue not present: d28676c

it('request slash', () => {
  cy.visit('index.html')
  // requests to /pageOne?param1=/param/ in 5.3.0
  // requests to /pageOne?param1=/param in 5.4.0+
  cy.request('/pageOne?param1=/param/')
})

5.3.0

Screen Shot 2020-11-30 at 10 26 49 AM

5.4.0

Screen Shot 2020-11-30 at 10 28 22 AM

@cypress-bot cypress-bot bot added the stage: needs investigating Someone from Cypress needs to look at this label Nov 30, 2020
@jennifer-shehane jennifer-shehane added type: unexpected behavior User expected result, but got another v5.4.0 🐛 Issue present since 5.4.0 stage: needs investigating Someone from Cypress needs to look at this and removed stage: needs investigating Someone from Cypress needs to look at this labels Nov 30, 2020
@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: needs investigating Someone from Cypress needs to look at this stage: work in progress labels Nov 30, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 2, 2020

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

@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Dec 2, 2020
@rwindt
Copy link
Author

rwindt commented Dec 2, 2020

Very nice! And what a speed, keep up the good work!

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 7, 2020

Released in 6.1.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: unexpected behavior User expected result, but got another v5.4.0 🐛 Issue present since 5.4.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants