fix: return bare Google URL in referer instead of search query

Real browsers send `https://www.google.com/` as the Referer header
when clicking search results, not the full search URL with query
parameters. The previous format was a fingerprinting signal that
the referer was spoofed.

Closes #172
This commit is contained in:
Andrew Barnes
2026-03-08 11:32:04 -04:00
parent 49db2b643b
commit 68b9e128bc
2 changed files with 5 additions and 6 deletions
+1 -2
View File
@@ -209,8 +209,7 @@ class TestFingerprintFunctions:
url = "https://sub.example.com/page.html"
result = generate_convincing_referer(url)
assert result.startswith("https://www.google.com/search?q=")
assert "example" in result
assert result == "https://www.google.com/"
def test_generate_convincing_referer_caching(self):
"""Test referer generation caching"""