summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAgustin Casagrande <56738079+agustincasagrande@users.noreply.github.com>2022-09-29 02:04:45 -0300
committerGitHub <noreply@github.com>2022-09-29 10:34:45 +0530
commit16bc9b16d2d66a6a15a34d579895f293e8685a7f (patch)
tree7597038c9af3dbc7419e150d3238d9597c38ca9f
parent691e36ac501a4b83447c13d18dac34fd12d80947 (diff)
refactor(ext/cache): remove extra headers iteration in cache.put (#16078)
-rw-r--r--ext/cache/01_cache.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/cache/01_cache.js b/ext/cache/01_cache.js
index 9c624b5d7..b08de3675 100644
--- a/ext/cache/01_cache.js
+++ b/ext/cache/01_cache.js
@@ -109,11 +109,9 @@
// Step 7.
const varyHeader = getHeader(innerResponse.headerList, "vary");
if (varyHeader) {
- const fieldValues = varyHeader.split(",").map((field) => field.trim());
- for (const fieldValue of fieldValues) {
- if (
- fieldValue === "*"
- ) {
+ const fieldValues = varyHeader.split(",");
+ for (const field of fieldValues) {
+ if (field.trim() === "*") {
throw new TypeError("Vary header must not contain '*'");
}
}