Closed Hulkmaster closed 3 years ago
also doesn't seem to be Cypress bug 🤔
cy.fixture('image/10kb-image.jpg', 'binary')
.then((file) => {
console.log(file.length);
})
.fixture('image/10kb-image.jpg', 'ascii')
.then((file) => {
console.log(file.length);
})
9916
9916
okay, seems like its route2
doing something during intercepting
works
cy.server().route('POST', '...').as('avatar');
does not work
cy.route2('POST', '...').as('avatar');
Description:
We have image upload test, which was working on cypress 5.2.0, now we decided to upgrade to 5.6.0, and we started to have error
(prev usage)
.attachFile('image/10kb-image.jpg')
(also not working)
(hack usage - works)
with default/binary usage
Content-Length: 10203
with ascii usage
Content-Length: 10204
So our backend responses with 422, because content length mismatch
(test image)![10kb-image](https://user-images.githubusercontent.com/2781622/98811158-a6beaf00-2420-11eb-86dc-2018f0831ac3.jpg)
Versions
Cypress: 5.6.0 Plugin: 4.1.1