Skip to content

Commit ee65f93

Browse files
committed
Fix redirect detection for HTTPS -> HTTPS redirect loops
Fixes http://cdt.org & closes issue EFForg#289 Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
1 parent 36866fb commit ee65f93

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

chromium/background.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,9 @@ function onCookieChanged(changeInfo) {
363363
}
364364

365365
function onBeforeRedirect(details) {
366-
// Catch HTTPs -> HTTP redirect loops, ignoring about:blank, HTTPS 302s, etc.
367-
if (details.redirectUrl.substring(0, 7) === "http://") {
366+
// Catch redirect loops (ignoring about:blank, etc. caused by other extensions)
367+
var prefix = details.redirectUrl.substring(0, 5);
368+
if (prefix === "http:" || prefix === "https") {
368369
if (details.requestId in redirectCounter) {
369370
redirectCounter[details.requestId] += 1;
370371
log(DBUG, "Got redirect id "+details.requestId+

0 commit comments

Comments
 (0)