You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
redirectHistory gains /robots.txt and CORS entries after a certificate retry #664
What information was incorrect, unhelpful, or incomplete?
When the first request fails certificate verification, Session.init() retries without verification and attaches the redirect-recording interceptor to clientInstance as well (src/retriever/session.js). The later /robots.txt request and the CORS preflight in retrieve() then append their own entries to session.redirectHistory when they return a 2xx status.
For a site with an invalid certificate where https://localhost:58556/ redirects to https://127.0.0.1:58556/:
after page load: 301 https://localhost:58556/, 200 https://127.0.0.1:58556/
after robots.txt: ..., 200 https://localhost:58556/robots.txt
after CORS OPTIONS: ..., 200 https://localhost:58556/robots.txt, 200 https://localhost:58556/robots.txt
As a result, redirectHistory.at(-1) is no longer the URL the page was served from:
The CORS preflight is sent to /robots.txt on the requested host instead of the final page URL.
The subresource integrity test derives the page origin from the requested host, so scripts on the final host count as a foreign origin.
responses.httpRedirects / responses.httpsRedirects share the same array, so the redirection test sees the extra entries when it uses that session.
What did you expect to see?
redirectHistory only contains the redirect chain of the page request, with or without a certificate retry.
Do you have any supporting links, references, or citations?
Activity