-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
pass matching mime type to xmldom; test [dynamicxml] #10830
Conversation
I did those changes from the github UI so far. I tried to guess the |
If the `Content-Type` header contains one of the mime types supported by `DOMParser`, the first matching mime type will be used instead of `text/xml`. The default is still `text/xml` for cases when the header is not present or none of the mime types from the list are present.
From my perspective it looks as if it's ready for review. |
Do any of the other values defined in |
Update I read your question again: The short answer is yes. There are the following affected areas:
But from my memory XHTML and HTML have (slightly different) special handling, especially regarding namespaces, everything else is currently just treated as XML. Why? |
I was mainly thinking about how it makes sense to test this tbh. What I've done for this PR is factored this out into a function and just added some tests for the content type parsing. I think when we upgrade to a version of xmldom with a fix for #10827 I will add a service test for an html document with a lowercase doctype as an integration test for it. Thanks |
Great, your refactoring and tests make a lot of sense to me. |
As discussed in #10827, If the
Content-Type
header contains one of the mime types supported byDOMParser
, the first matching mime type will be used instead oftext/xml
.The default is still
text/xml
for cases when the header is not present or none of the mime types from the list are present.