Refactor cacheKey request formatting
Reformats the construction of the cacheKey Request object for improved readability and consistency in indentation.
This commit is contained in:
1 parent
d88f1911a6
commit
7036cbd39e
1 file changed
+5
-5
+5
-5
@@ -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
|
||||
|
||||
Reference in new issue
Block a user