-
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
Overriding user-agent when using cy.request #3873
Comments
I already have a working PR to handle this if you guys are ok to integrate the feature. |
Hey @AbdullahZN, yes we would love an open PR - even one that is a work in progress is fine. Check out our contributing doc and ask us if you get stuck. Also, you can set the There's some explanation on why we implemented it this way here: #364 Also relevant issue regarding user-agent here: #3719 |
Thanks @jennifer-shehane, I just opened the PR for this feature. |
Yes, that sounds right |
The code for this is done in cypress-io/cypress#3920, but has yet to be released. |
Released in |
Current behavior:
cy.request
overrides the user-agent if it is provided in theoptions.headers
object of the requestDesired behavior:
If the
User-agent
is explicitly set inoptions.headers
object when usingcy.request
it should not be overwritten with the current browsing session's user-agent.Steps to reproduce: (app code and test code)
e.g:
This implementation
leads to:
Versions
Cypress: 3.1.5
OS: MacOS 10.13.3
Browser: Chrome - Version 73.0.3683.86
The text was updated successfully, but these errors were encountered: