Skip to content

Commit 2f107d7

Browse files
author
Lalit Sharma
committed
feat: update browser headers to mimic consented desktop Chrome and bypass GDPR
1 parent 9c87929 commit 2f107d7

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

apps/mobile/src/utils/sharedMapLink.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,25 @@ const GOOGLE_CENTER_ARRAY_RE = new RegExp(
6666
"i",
6767
);
6868

69-
// Browser headers to avoid consent pages
69+
// Browser headers to mimic consented desktop Chrome and bypass GDPR
7070
const BROWSER_HEADERS = {
7171
"user-agent":
72-
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
73-
accept: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
74-
"accept-language": "en-GB,en;q=0.9",
72+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
73+
accept:
74+
"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
75+
"accept-encoding": "gzip, deflate, br",
76+
"accept-language": "en-US,en;q=0.9",
77+
"cache-control": "max-age=0",
78+
"sec-ch-ua": '"Chromium";v="131", "Not_A Brand";v="24"',
79+
"sec-ch-ua-mobile": "?0",
80+
"sec-ch-ua-platform": '"Windows"',
81+
"sec-fetch-dest": "document",
82+
"sec-fetch-mode": "navigate",
83+
"sec-fetch-site": "none",
84+
"sec-fetch-user": "?1",
85+
"upgrade-insecure-requests": "1",
86+
// Consent cookie to bypass GDPR interstitial
87+
cookie: "CONSENT=PENDING+999; SOCS=CAESHAgBEhJnd3NfMjAyNDAxMTAtMF9SQzIaAmVuIAEaBgiA9-GtBg",
7588
};
7689

7790
type ExpandedShortMapUrlResult = {

0 commit comments

Comments
 (0)