content-length header is lost under Cypress.
See original GitHub issueCurrent behavior
When using Cypress, no content-length
header is returned.
This error is not reproduced when using the functionality without Cypress.
Desired behavior
Content length is returned.
Test code to reproduce
git clone https://github.com/dvkruchinin/cvat.git
cd cvat
git checkout case77-for-cypress-issue
docker-compose -f docker-compose.yml -f docker-compose.dev.yml build
docker-compose up -d
docker exec -it cvat bash -ic 'python3 ~/manage.py createsuperuser'
user: admin
email: <can leave it empty>
password: 12qwaszx
cd tests
npm ci
npx cypress open
run the test actions_objects2/case_77_intelligent_scissors.js
For checking without Cypress:
Open Chrome
Go to http://localhost:8080
Login as admin
password 12qwaszx
And reproduce the actions from the test
Versions
Cypress version: 6.4.0, 7.3.0 Browser: Chome Version 90.0.4430.93 (Official Build) (64-bit) OS: 20.04.1-Ubuntu
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:18
Top Results From Across the Web
Content-length header is not getting set in response to client
We have a requirement where we need to send content-length header in the response of a MPGW service to a client which listens...
Read more >How can I set my request headers in Cypress to avoid ...
On my side, it work with visit() function. The url used will show you header sent. Hope this code sample can help you...
Read more >Changelog - Cypress Documentation
Fixes an issue introduced in 10.3.0 where network logs could be missing ... Added icons to help indicate that column headers provide more...
Read more >@cypress/request - npm Package Health Analysis | Snyk
Looks like @cypress/request is missing a security policy. ... When doing so, content-type and content-length are preserved in the PUT headers.
Read more >huge json data in response and Content-Length Header
There are some signs missing and the json String cannot be decoded on JS side. ... How do you set the Content-Length Header-Variable,...
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 FreeTop 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
Top GitHub Comments
Here’s an example, it goes in your Cypress code:
Notice you’ll have to update it when you change your mock or things can/will break. I think it might be possible to make this seamless by reading your mock with
fs.readFileSync
and calculating the content length.I am experiencing the same problem. Thanks for the workaround but it I hope it will fixed