Skip to content

Commit e0abd51

Browse files
author
yan
committed
Don't block HSTS requests in HTTP Nowhere mode
1 parent 6500585 commit e0abd51

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/chrome/content/code/HTTPS.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
INCLUDE('Cookie');
22

3+
var securityService = CC['@mozilla.org/ssservice;1']
4+
.getService(CI.nsISiteSecurityService);
5+
36
// Hack. We only need the part of the policystate that tracks content
47
// policy loading.
58
const PolicyState = {
@@ -37,9 +40,11 @@ const HTTPS = {
3740
*/
3841
replaceChannel: function(applicable_list, channel, httpNowhereEnabled) {
3942
var blob = HTTPSRules.rewrittenURI(applicable_list, channel.URI.clone());
43+
var isSTS = securityService.isSecureURI(
44+
CI.nsISiteSecurityService.HEADER_HSTS, channel.URI, 0);
4045
if (blob === null) {
4146
// Abort insecure requests if HTTP Nowhere is on
42-
if (httpNowhereEnabled && channel.URI.schemeIs("http")) {
47+
if (httpNowhereEnabled && channel.URI.schemeIs("http") && !isSTS) {
4348
IOUtil.abort(channel);
4449
}
4550
return false; // no rewrite

0 commit comments

Comments
 (0)