Refactor cacheKey request formatting

Reformats the construction of the cacheKey Request object for improved readability and consistency in indentation.
This commit is contained in:
xixu-me committed 2025-12-08 19:23:07 +08:00
1 parent d88f1911a6
commit 7036cbd39e
1 file changed
+5 -5
+5 -5
View File
@@ -1328,11 +1328,11 @@ async function handleRequest(request, env, ctx) {
// Always use GET method for cache key
const cacheKey = rangeHeader
? new Request(targetUrl, {
method: 'GET',
headers: new Headers(
[...request.headers.entries()].filter(([k]) => k.toLowerCase() !== 'range')
)
})
method: 'GET',
headers: new Headers(
[...request.headers.entries()].filter(([k]) => k.toLowerCase() !== 'range')
)
})
: new Request(targetUrl, { method: 'GET' });
// Use waitUntil if available (Cloudflare Workers), otherwise cache synchronously