gecko-dev/toolkit/components/captivedetect
Valentin Gosu 40d01075ce Bug 1556259 - Make sure CaptiveDetect.jsm interprets any redirect as a locked captive portal r=mayhemer
The problem with CaptiveDetect was that it uses an XMLHttpRequest, and
apparently xhr.status is 0 for failed requests, which here includes cert
errors, redirect loops, etc.
Getting the XHR to not follow redirects was tricky, so a hacky fix was to
set nsIHttpChannel.redirectionLimit = 0;
For any redirect the XHR would now fail with NS_ERROR_REDIRECT_LOOP, which
we need to handle separately.

I also included tests for:
  * redirect to https with invalid cert
  * redirect to same URL causing redirect loop
  * redirect to different URL with different content
  * redirect to different URL with canonical content
All of these cases should be detected as locked captive portals.

Differential Revision: https://phabricator.services.mozilla.com/D33706

--HG--
extra : moz-landing-system : lando
2019-06-06 12:08:35 +00:00
..
test/unit Bug 1544284 - toolkit/ automated ESLint no-throw-literal fixes. r=Standard8 2019-04-16 19:30:27 +00:00
CaptiveDetect.jsm Bug 1556259 - Make sure CaptiveDetect.jsm interprets any redirect as a locked captive portal r=mayhemer 2019-06-06 12:08:35 +00:00
components.conf Bug 1524688: Part 40 - Convert CaptiveDetect to static registration. r=mconley 2019-01-30 10:48:56 -08:00
moz.build Bug 1524688: Part 40 - Convert CaptiveDetect to static registration. r=mconley 2019-01-30 10:48:56 -08:00
nsICaptivePortalDetector.idl Bug 1488628 - Change some nsICaptivePortalDetector method arguments from wstring to AString. r=valentin 2018-09-05 13:40:04 +10:00