Hello net-dev,
I'm trying to reliably get the top frame's origin within URLRequestHttpJob. I'm aware of `HttpRequestInfo::possibly_top_frame_origin()` and how it could sometimes be a site or nullopt instead of an origin. I already have one possible solution (see below) but I'm wondering if there's a better way.
For my use case I only care about requests that could result in an HSTS response header, `Strict-Transport-Security:`. Meaning that requests like DoH, browser internal stuff like the safebrowsing updates, etc aren't applicable.
After speaking with mmenke@ the current best idea is to check if cookies are allowed via `ShouldBlockAllCookies(request_info_.privacy_mode)`. Since only cookie-able requests should be capable of setting an HSTS header. Using `ShouldBlockAllCookies()` avoids checking the network delegate which could be blocking on a per-site basis.
Does anyone have any better ideas?
Thanks,
Steven