mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
refactor(ext/cache): remove extra headers iteration in cache.put (#16078)
This commit is contained in:
parent
691e36ac50
commit
16bc9b16d2
1 changed files with 3 additions and 5 deletions
8
ext/cache/01_cache.js
vendored
8
ext/cache/01_cache.js
vendored
|
@ -109,11 +109,9 @@
|
||||||
// Step 7.
|
// Step 7.
|
||||||
const varyHeader = getHeader(innerResponse.headerList, "vary");
|
const varyHeader = getHeader(innerResponse.headerList, "vary");
|
||||||
if (varyHeader) {
|
if (varyHeader) {
|
||||||
const fieldValues = varyHeader.split(",").map((field) => field.trim());
|
const fieldValues = varyHeader.split(",");
|
||||||
for (const fieldValue of fieldValues) {
|
for (const field of fieldValues) {
|
||||||
if (
|
if (field.trim() === "*") {
|
||||||
fieldValue === "*"
|
|
||||||
) {
|
|
||||||
throw new TypeError("Vary header must not contain '*'");
|
throw new TypeError("Vary header must not contain '*'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue