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

Overriding user-agent when using cy.request or cy.visit #3920

Merged
merged 4 commits into from
May 1, 2019

Conversation

AbdullahZN
Copy link
Contributor

@AbdullahZN AbdullahZN commented Apr 9, 2019

Added possibility to override user-agent headers for request.sendannd request.sendStream

Since headers can be provided by the client either in lowercase/uppercase/mix of both:

  • I also added a method to lowercase all the provided headers

💡 I don't know where this kind of utils method should go, is it fine in the request.coffee ?

Closes #3873
Closes #3719

@CLAassistant
Copy link

CLAassistant commented Apr 9, 2019

CLA assistant check
All committers have signed the CLA.

@AbdullahZN
Copy link
Contributor Author

Errors look unrelated to the changes. Can we try a rebuild ?

@jennifer-shehane jennifer-shehane requested a review from a team April 10, 2019 06:06
@jennifer-shehane
Copy link
Member

@AbdullahZN
Copy link
Contributor Author

Hi,
Any update on this ?

@AbdullahZN
Copy link
Contributor Author

Thanks for the review @flotwig, corrected 👍

@flotwig
Copy link
Contributor

flotwig commented Apr 16, 2019

Looks good @AbdullahZN, but the same unit test is failing every time this PR runs, so that will need to be figured out before this can be merged.

@AbdullahZN
Copy link
Contributor Author

I'll dig into that. It's hard to debug though: tests are failing on my local develop branch 🤔

@AbdullahZN
Copy link
Contributor Author

@flotwig It's ok now, tests are green 🍏 :)

flotwig
flotwig previously approved these changes Apr 30, 2019
@flotwig flotwig self-requested a review April 30, 2019 15:41
@flotwig
Copy link
Contributor

flotwig commented Apr 30, 2019

I think this will also fix #3719, since cy.visit() goes through request. Unless there's some other place where user-agent gets written.

@AbdullahZN
Copy link
Contributor Author

It will require a bit more work. I'll try to handle it in another PR

@jennifer-shehane jennifer-shehane requested a review from a team May 1, 2019 02:52
@flotwig
Copy link
Contributor

flotwig commented May 1, 2019

@AbdullahZN I added a test in your branch for cy.visit user-agent, it appears to be passing with just the changes you've made: 3d1c832

We can close #3719 too then, nice

@flotwig flotwig changed the title Overriding user-agent when using cy.request Overriding user-agent when using cy.request or cy.visit May 1, 2019
@flotwig flotwig merged commit bf4ac81 into cypress-io:develop May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overriding user-agent when using cy.request visit() does not send user agent header as specified
4 participants