cy.visit does not send headers / change HTTP method when baseUrl contains `:80`
See original GitHub issueCurrent behavior:
cy.visit({ url, method, headers })
does not appear to honour the method
, or headers
Desired behavior:
cy.visit({ url, method, headers })
should send the specified method and headers.
Steps to reproduce: (app code and test code)
cy.visit({
url: '/ui',
method: 'POST',
headers: {
'mock-user': JSON.stringify(mockUser)
}
});
I include an annotated Cypress debug log:
Changing the method to GET
still results in the headers not being sent
Versions
I tested Cypress 3.4.1 and 3.2.0. Ubuntu LTS Chrome 77
UPDATE: Cause tracked down to: https://github.com/cypress-io/cypress/issues/5367#issuecomment-542329058
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
visit - Cypress Documentation
Note: headers will only be sent for the initial cy.visit() request, not for any subsequent requests. qs, null, Query parameters to append to...
Read more >cypress-io/cypress - Gitter
Hi guys! I am trying to spin up my first ever test with Cypress and I am kinda bummed at not being able...
Read more >Cypress: How to visit a url of a different origin? - Stack Overflow
I have my base URL set to the domain I want to test, the issue is when I want to test the ability...
Read more >@cypress/request - npm
The HTTP method, headers, and entity-body data will be sent. ... are set, they will be used to proxy non-SSL requests that do...
Read more >Challenge solutions - Pwning OWASP Juice Shop
Visit http ://localhost:3000/#/basket to solve the challenge. If the challenge is not immediately solved, you might have to F5 -reload to relay the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Released in
3.6.1
.Ugh, that definitely sounds possible. The
cy.visits
are cached by URL, maybe we’re keeping the default port when storing the response but not when pulling it back out, or vice versa. Thanks for tracking this down, this should be pretty easy to fix now.