-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Have cy.request support urls with specials Unicodes chars #5813
Conversation
Use encodeURI inside `cy.request` to make sure the url does not contain any unescaped Unicode character. Fixes cypress-io#5274
Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.
PR Review ChecklistIf any of the following requirements can't be met, leave a comment in the review selecting 'Request changes', otherwise 'Approve'. User Experience
Functionality
Maintainability
Quality
Internal
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening this PR!
Use `URL constructor` inside `cy.request` to make sure the url is well encoded when for both domain and pathname. Fixes cypress-io#5274
packages/driver/test/cypress/integration/issues/5274_spec.coffee
Outdated
Show resolved
Hide resolved
packages/driver/test/cypress/integration/issues/5274_spec.coffee
Outdated
Show resolved
Hide resolved
After review comments, I've changed the way I deal with the URL encoding. I've also refactored the tests to fix the issue raised by @brian-mann |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one minor thing about how the tests are organized and then looks good.
packages/driver/test/cypress/integration/issues/5274_spec.coffee
Outdated
Show resolved
Hide resolved
- Move the tests inside the request_spec test file instead of his own test file to be sure it will be maintain. - Rename some "it" test titles to semantically fit in the actual tests naming convention. - Remove the no more used 5274_spec.coffee test file.
User facing changelog
cy.request
will now automatically encode special characters in the request URL, including Unicode.Additional details
’
) was throwing anERR_UNESCAPED_CHARACTERS
error.How has the user experience changed?
Before
After
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?