Fix redirect for misspelled queries starting with /

Fixes #818
This commit is contained in:
Ben Busby 2022-08-01 12:12:55 -06:00
parent bf92944b95
commit 78614877f2
No known key found for this signature in database
GPG Key ID: B9B7231E01D924A1

View File

@ -462,7 +462,7 @@ class Filter:
result_link = urlparse.urlparse(href)
q = extract_q(result_link.query, href)
if q.startswith('/') and q not in self.query:
if q.startswith('/') and q not in self.query and 'spell=1' not in href:
# Internal google links (i.e. mail, maps, etc) should still
# be forwarded to Google
link['href'] = 'https://google.com' + q