Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling json content-type in IE11 response. #753

Closed
joetidee opened this issue Feb 9, 2020 · 1 comment
Closed

Handling json content-type in IE11 response. #753

joetidee opened this issue Feb 9, 2020 · 1 comment

Comments

@joetidee
Copy link

joetidee commented Feb 9, 2020

A while ago we implemented a workaround for IE11 ignoring the application/json content-type (naugtur/xhr#123) by defaulting to parsing the response using .text():

const contentType = response.headers.get('content-type');
    const parsedResponseByContentType =
        contentType && contentType.includes('application/json') ? response.json() : response.text();

Is this still needed, or has the a polyfill been written to ensure that IE11 returns the raw response object instead of an empty string?

@dgraham
Copy link
Contributor

dgraham commented Feb 20, 2020

This polyfill does not use responseType: json and just parses the text response body.

@dgraham dgraham closed this as completed Feb 20, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants