Skip to content

Commit 0a7b8ba

Browse files
BigBlueHatdlongley
authored andcommitted
Fix the Mixed Content mess in XHR Requests (#165)
Using https://www.w3.org/TR/upgrade-insecure-requests/ Added to the two browser-based document loaders: jquery & xhr
1 parent 7e90a96 commit 0a7b8ba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

js/jsonld.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,8 @@ jsonld.documentLoaders.jquery = function($, options) {
16871687
},
16881688
// ensure Accept header is very specific for JSON-LD/JSON
16891689
headers: {
1690-
'Accept': 'application/ld+json, application/json'
1690+
'Accept': 'application/ld+json, application/json',
1691+
'Upgrade-Insecure-Requests': '1'
16911692
},
16921693
dataType: 'json',
16931694
crossDomain: true,
@@ -1964,6 +1965,7 @@ jsonld.documentLoaders.xhr = function(options) {
19641965
{contextUrl: null, documentUrl: url, document: null});
19651966
};
19661967
req.open('GET', url, true);
1968+
req.setRequestHeader('Upgrade-Insecure-Requests', '1');
19671969
req.setRequestHeader('Accept', 'application/ld+json, application/json');
19681970
req.send();
19691971
}

0 commit comments

Comments
 (0)