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

responseType=document only supports XML not HTML #194

Open
kaikiai opened this issue Mar 16, 2022 · 2 comments
Open

responseType=document only supports XML not HTML #194

kaikiai opened this issue Mar 16, 2022 · 2 comments
Labels

Comments

@kaikiai
Copy link

kaikiai commented Mar 16, 2022

I discovered a problem with responseType='document' in FakeXHR.
When using responseType in browser it is usable with XML and with HTML.

FakeXHR only works with XML

function convertResponseBody(responseType, contentType, body) {
....
} else if (responseType === "document") {
    if (isXmlContentType(contentType)) {
        return FakeXMLHttpRequest.parseXML(body);
    }
    return null;
}

should also be usable with content-type='text/html' and then not parsing with XML but instead use a parser with text/html as mime-type

@fatso83
Copy link
Contributor

fatso83 commented Dec 5, 2022

Just file a PR to handle this. This seems fine.

Copy link

stale bot commented Dec 27, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants