Skip to content

Commit

Permalink
Merge branch 'jb50423' into 'master'
Browse files Browse the repository at this point in the history
[embedlite-components] Upgrade google requests to https. Fixes JB#50423

See merge request mer-core/embedlite-components!90
  • Loading branch information
rainemak committed Nov 2, 2020
2 parents 77f7e45 + 7438fea commit 762b37a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jscomps/UserAgentOverrideHelper.js
Expand Up @@ -99,6 +99,10 @@ var UserAgent = {
onModifyRequest(aSubject, aTopic, aData) {
if (aTopic === "http-on-modify-request") {
let channel = aSubject.QueryInterface(Ci.nsIHttpChannel);
// Cover all google domains
if (!channel.URI.schemeIs("https") && channel.URI.asciiHost.indexOf(".google.") !== -1) {
channel.upgradeToSecure();
}
let ua = this.onRequest(channel, this.getDefaultUserAgent());
channel.setRequestHeader("User-Agent", ua, false);
}
Expand Down

0 comments on commit 762b37a

Please sign in to comment.