`cy.intercept` on file upload endpoints seems to be reading the file stream, which can result in server-side throwing error
See original GitHub issueThis is easy to work around, so don’t stress about it too much. Just wanted to report in case it helps.
Current behavior
If I cy.intercept('POST', /profile\/picture/i).as('upload')
to watch an endpoint that consumes a file upload, my .net core 3 server errors with “System.IO.IOException: Unexpected end of Stream, the content may have already been read by another component.”
Desired behavior
Maybe cypress just needs to set the stream position back to 0?
Versions
- Cypress@6.0.1
- Chrome 87 (the one cypress opens)
- Win10
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (1 by maintainers)
Top Results From Across the Web
intercept - Cypress Documentation
Verifying the request modification cy. intercept() cannot be debugged using cy. request() ! Cypress only intercepts requests made by your front-end application.
Read more >Cypress cy.intercept Problems - Gleb Bahmutov
The command cy.intercept can match requests using a substring, a minimatch, or a regular expression. By default, it intercepts requests matching ...
Read more >Cypress Error making HTTP POST with File in request body
The error only occurs when the function is run by a Cypress test. Cypress uses Node.js, and judging by the error message above...
Read more >Untitled
Moc is the meta object compiler which is a widely used tool with Qt and creates standard C++ files to provide syntactic sugar...
Read more >Securing Web Transactions: TLS Server Certificate Management
certificates risk system outages and security breaches, which can result in revenue loss, ... Most private keys used on TLS servers are stored...
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
FWIW The issue I had here was fixed in 6.2.1 🎉
I ended up just using ui loading indicators to know when the network request is completed. So something like this: