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

Fix issue where no parsererror is returned on invalid XML #55

Merged
merged 1 commit into from Jun 2, 2018
Merged

Fix issue where no parsererror is returned on invalid XML #55

merged 1 commit into from Jun 2, 2018

Conversation

m90
Copy link
Contributor

@m90 m90 commented Jun 2, 2018

This fixes #54 but would introduce the situation where using slightly broken DOMParsers like xmldom would make this test:

it("is null when the response body contains invalid XML", function () {
this.xhr.open("GET", "/");
this.xhr.send();
this.xhr.respond(200, { "Content-Type": "application/xml" },
"!!!<?xml version=\"1.0\" encoding=\"UTF-8\"?><broken>");
assert.isNull(this.xhr.responseXML);
});
fail as it would return a document instead of null.

@fatso83
Copy link
Contributor

fatso83 commented Jun 2, 2018

Thank you!

@fatso83 fatso83 merged commit 9b5330f into sinonjs:master Jun 2, 2018
var parsererrorNS = parser.parseFromString("INVALID", "text/xml")
.getElementsByTagName("parsererror")[0].namespaceURI;
var parsererrors = parser
.parseFromString("INVALID", "text/xml")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is an error
#57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fake XHR XML document parser fails to parse.
3 participants