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.

Content with charset breaks the responseType

See original GitHub issue

The inferResponseType checks for ending of the media type:

if (mediaType.endsWith('/json') || mediaType.endsWith('+json')) {

But it’s quite usual to have it like this:

  content:
    application/json; charset=utf-8:
      ...

Which breaks the inference and makes the responseType to be “blob”. I guess this can be considered as a bug… Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
luisfpgcommented, Jun 17, 2021

@Zryru This was already fixed in version 0.17.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP response with content-type `text/html; charset="utf-8 ...
It seems Facebook's response has: text/html; charset="utf-8" as the content-type header. We are not removing the quotes, which seem to be ...
Read more >
Can charset parameter be used with application/json content ...
It can only break clients that parse Content-Type header incorrectly e.g., by comparing it verbatim with "application/json" or clients that ...
Read more >
UTF-8 fix breaks content-type headers?
This fixes the queryBuilder returning data with the wrong charset in the servlet, but has the side effect of making the response header...
Read more >
HttpClient: How to remove charset from Content-Type header
I was writing client library for one online service and faced situation where I had to remove charset definition from Content-Type header.
Read more >
The "charset=UTF-8" part is added for the Content-Type header
I expect a request Content-Type header to be application/json (like in 1.6. 7) but actually it's application/json; charset=UTF-8 . The changed behavior ...
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