"Did you mean" infobar shows on all single-word searches due to weird ISP behavior |
||
Issue descriptionLast week I encountered a network where the infobar shows up on all single-word searches. GET requests to URLs like "http://search/" (or any other word) go to a spammy search page run by the ISP. The normal detection for this behavior doesn't work on this network because on HEAD requests, instead of the search page, the response is a 301 redirect to "http://localhost/" which results in ERR_CONNECTION_REFUSED. (Not relevant to the bug, but interesting: it also does that if you send it a GET request with a User-Agent string from curl or a few popular languages' HTTP libraries. It sends the search page for User-Agent strings from more obscure HTTP libraries and all browsers I tried.) I have a net-export log and some more notes if you need more info, but I'm back home now so I probably can't do more debugging beyond what I already checked. It looks like the cause of this is that ChromeOmniboxNavigationObserver and IntranetRedirectDetector treat a redirect followed by a network error differently. ChromeOmniboxNavigationObserver doesn't follow the redirect, so it treats it as an existing page. IntranetRedirectDetector treats it as a network error and doesn't look at whether a redirect happened. As I understand it, IntranetRedirectDetector is only used for this feature, so changing it to treat a redirect followed by a network error as a redirect wouldn't break anything I can think of. But I know this area is full of edge cases.
,
Jan 5 2018
A third option: Currently the code does: // If any two fetches result in the same domain/host, we set the redirect // origin to that; otherwise we set it to nothing. but it restricts this analysis only to successful fetches. What's the harm in looking at the file URL attempted to be fetched and seeing if those final URLs are the same domain/host?
,
Jan 5 2018
Failed fetches that all get sent to a central location may be some legit "no site for this intranet host" handling?
,
Jan 5 2018
Isn't that effectively the same thing as what the intranet redirect detector is trying to catch? Some "no site for this intranet host" handling (in typical case showing search results at the same time)...
,
Jan 5 2018
Hmm. I guess the assumption is that a failed load won't trigger the infobar. But as noted elsewhere, a redirect to something that fails _will_ trigger the infobar. That is, maybe the original proposed solution is the right one after all, because it keeps the two classes in sync. Though maybe doing GET instead of HEAD is also a good change.
,
Jan 22 2018
,
Jul 20
showing suggestions for localhost seems a bit risky |
||
►
Sign in to add a comment |
||
Comment 1 by pkasting@chromium.org
, Jan 2 2018