|
@@ -12,10 +12,14 @@ function resolveUrl (origin, link) {
|
|
|
}
|
|
|
|
|
|
function isXml (content, xhr) {
|
|
|
- const contentType = (xhr.headers ? xhr.headers['content-type'] : xhr.getResponseHeader('Content-Type'))
|
|
|
-
|
|
|
- .replace(/;.*$/, '')
|
|
|
- .toLowerCase()
|
|
|
+ const rawContentType = (xhr.headers ? xhr.headers['content-type'] : xhr.getResponseHeader('Content-Type'))
|
|
|
+
|
|
|
+ if (rawContentType === null) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ const contentType = rawContentType.replace(/;.*$/, '').toLowerCase()
|
|
|
if (typeof contentType === 'string') {
|
|
|
if (contentType === 'application/xml' || contentType === 'text/xml') {
|
|
|
return true
|