From 40c73465165ac2b870f882461c7f6d6a671ddeb2 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Sat, 16 Sep 2023 07:50:38 +0100 Subject: [PATCH] refactor(vary): use word character class --- vary.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vary.js b/vary.js index a10324d..4ff5e8c 100644 --- a/vary.js +++ b/vary.js @@ -20,7 +20,7 @@ const LRUCache = require('mnemonist/lru-cache') * @see https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6 */ -const validFieldnameRE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/ +const validFieldnameRE = /^[!#$%&'*+\-.^\w`|~]+$/u function validateFieldname (fieldname) { if (validFieldnameRE.test(fieldname) === false) { throw new TypeError('Fieldname contains invalid characters.')