question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

intercept() sometimes parses request or response body as ArrayBuffer

See original GitHub issue

Current behavior

Some intercepts don’t parse request or response body well, instead of JSON, it is parsed as ArrayBuffer. Screenshot 2021-06-22 at 10 47 49

Test code to reproduce

You can find the whole code example here. I was unable to pin down what kind of response or request body caused this. I tried to create a minimalistic example but I ended up just copying the whole payload from the app I’m testing.

Versions

Problem appears from v7 and higher. .intercept() actually behaves well on 6.x versions.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:5
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
GlebkaFcommented, Jul 19, 2021

same issue with Russian letters

2reactions
lorenzogrvcommented, Jul 30, 2021

Similar issue with tilde latin letters (áéíóú) with cypress version 7.6.0. Few notes:

  • Upgrading to 8.1.0 did not help
  • Downgrading to 6.9.1 worked

I’ve also found https://github.com/cypress-io/cypress/issues/16292 which seems fixed, but may not.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cypress 9.6.0 - response returned from cy.request has a body ...
The issue is that instead of an ArrayBuffer I should be getting normal JSON format response (ofc during the test in the app...
Read more >
Response.arrayBuffer() - Web APIs - MDN Web Docs
In getData() we create a new request using the Request() constructor, then use it to fetch an OGG music track. We also use...
Read more >
The new Angular HttpClient API - Medium
The intercept method receives an HttpRequest and must return an stream of HttpEvent of type HttpResponse . As the Request and Response objects...
Read more >
7 Ways to Leverage HttpInterceptors in Angular - Bits and Pieces
HttpInterceptors, as their name suggests, intercept Http requests made ... This is used to parse the response appropriately before returning ...
Read more >
parse-request - npm
Parse requests in the Browser and Node (with added support for ... a 10MB file image upload sent across the request body as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found