Skip to content
This repository was archived by the owner on Nov 15, 2017. It is now read-only.

Commit ea726ee

Browse files
committed
this fixes #404
1 parent 6de0dc8 commit ea726ee

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

js/traffic.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,17 @@ var onMainDocHeadersReceived = function(details) {
749749
return;
750750
}
751751

752+
// https://github.com/gorhill/httpswitchboard/issues/404
753+
// Do not inject CSP for XML documents.
754+
// Since the previous behavior is to always inject CSP at this point,
755+
// I am being very conservative with the fix: I chose to specifically not
756+
// inject CSP for XML documents, rather then not inject CSP if not a
757+
// HTML document in order to limit to a minimum the change in behavior.
758+
i = headerIndexFromName('content-type', headers);
759+
if ( i === -1 || headers[i].value.search('text/xml') !== -1 ) {
760+
return;
761+
}
762+
752763
// https://github.com/gorhill/httpswitchboard/issues/181
753764
pageStats.pageScriptBlocked = true;
754765

0 commit comments

Comments
 (0)