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.

transfer-encoding chunked not handled for application/json

See original GitHub issue

Summary

I am receiving JSON via chunked encoding. response.data comes back as a string. It is not properly parsed as the headers instruct. I would expect to get a JSON object back for res.data.

Response Headers:

Content-Type: application/json
Transfer-Encoding: chunked, chunked

Response Data:

23\r\n
{"rejected":0,"inserted/updated":1}\r\n
0\r\n
\r\n
\r\n

Theoretically this response would also be valid:

18\r\n
{"rejected":0,"inserted/update\r\n
5\r\n
d":1}\r\n
0\r\n
\r\n
\r\n

Context

  • axios version: e.g.: 0.18.0
  • Environment: e.g.: node v8.10.0, High Sierra

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:24 (3 by maintainers)

github_iconTop GitHub Comments

19reactions
eleven-net-cncommented, Nov 24, 2022

The same exception about transfer-encoding: chunked with axios@1.2.0, and revert to v1.1.3 will work fine.

11reactions
sroetteringcommented, Nov 23, 2022

Hi @jasonsaayman , there seems to be a regression on this topic with the new 1.2.0 version. In version 1.1.3 this was still fixed but now it is broken again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

spring - how to handle "Transfer-Encoding=chunked" in SI ...
I am using a JSON to object transformer to convert the JSON data. But I am getting the following exception. Caused by: com.fasterxml.jackson....
Read more >
How HTTP Chunked Encoding was killing a request
Transfer -Encoding: chunked - there is no content length specified, the server tells us it will send a bunch of chunks whenever it...
Read more >
Transfer-Encoding - HTTP - MDN Web Docs
Chunked encoding is useful when larger amounts of data are sent to the client and the total size of the response may not...
Read more >
Issue with POST request with JSON body - Axway Community
When using chunked transfer encoding, the body is sent in chunks, and each chunk is preceded by its byte size in hexadecimal, with...
Read more >
KSC Open API description - Kaspersky Knowledge Base
If not, it means the type "application/json". "Content-Length" If not presented, must be header "Transfer-Encoding" with "chunked" value instead.
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