Spoleto
04/04/2023, 2:12 PMSkye
04/04/2023, 2:12 PMSpoleto
04/04/2023, 2:13 PMSpoleto
04/04/2023, 2:13 PMSpoleto
04/04/2023, 2:14 PMzaeem
04/04/2023, 2:23 PMkian
04/04/2023, 2:24 PMaccount_id
key in wrangler.toml
?Spoleto
04/04/2023, 2:25 PMkian
04/04/2023, 2:27 PMjs
const url = new URL(request.url);
if (url.searchParams.has('ajax')) {
return fetch(request);
}
Spoleto
04/04/2023, 2:59 PMSpoleto
04/04/2023, 2:59 PMconst url = new URL(request.url);
if (url.search.includes('?gclid') || url.search.includes('?fbclid')) {
response.headers.set(
"Set-Cookie",
"pricing-mode=on;max-age=604800;Path=/"
)
}kian
04/04/2023, 3:05 PM?gclid
and ?fbclid
are assuming that it's the very first search parameter which isn't always true - use the .searchParams.has
method that I used for ajax
.kian
04/04/2023, 3:05 PMheaders.set
to be headers.append
so it can support multiple `Set-Cookie`headers as necessary.Spoleto
04/04/2023, 3:09 PMSpoleto
04/04/2023, 3:18 PMmojmir
04/04/2023, 4:45 PMfetch
with request headers or without them. Our worry is that CF wouldn't be as efficient as if we called it without headers. (we're concerns are passing If-None-Match
header and range requests). Has anyone asked the same question? thanks!SupulCFG
04/04/2023, 5:36 PMdave
04/04/2023, 6:30 PMSpoleto
04/04/2023, 9:41 PMSpoleto
04/04/2023, 9:46 PMsilentdevnull
04/05/2023, 2:30 AMJames
04/05/2023, 2:34 AMsilentdevnull
04/05/2023, 3:42 AMvector
04/05/2023, 3:53 AMvector
04/05/2023, 3:54 AMkeithj
04/05/2023, 4:01 AMUnsmart | Tech debt
04/05/2023, 4:06 AMUnsmart | Tech debt
04/05/2023, 4:07 AMvector
04/05/2023, 7:03 AMicedwave
04/05/2023, 8:30 AM