ce9c58
From 201c8b23df7bf986276e62b03f8276e18ef49728 Mon Sep 17 00:00:00 2001
ce9c58
From: Kornel <kornel@geekhood.net>
ce9c58
Date: Fri, 27 Jan 2023 01:20:38 +0000
ce9c58
Subject: [PATCH] deps(http-cache-semantics): Don't use regex to trim
ce9c58
 whitespace
ce9c58
ce9c58
upstream-patch: https://github.com/kornelski/http-cache-semantics/commit/560b2d8ef452bbba20ffed69dc155d63ac757b74
ce9c58
Signed-off-by: rpm-build <rpm-build>
ce9c58
---
ce9c58
 deps/npm/node_modules/http-cache-semantics/node4/index.js | 8 ++++----
ce9c58
 1 file changed, 4 insertions(+), 4 deletions(-)
ce9c58
ce9c58
diff --git a/deps/npm/node_modules/http-cache-semantics/node4/index.js b/deps/npm/node_modules/http-cache-semantics/node4/index.js
ce9c58
index bcdaebe..e427106 100644
ce9c58
--- a/deps/npm/node_modules/http-cache-semantics/node4/index.js
ce9c58
+++ b/deps/npm/node_modules/http-cache-semantics/node4/index.js
ce9c58
@@ -21,7 +21,7 @@ function parseCacheControl(header) {
ce9c58
 
ce9c58
     // TODO: When there is more than one value present for a given directive (e.g., two Expires header fields, multiple Cache-Control: max-age directives),
ce9c58
     // the directive's value is considered invalid. Caches are encouraged to consider responses that have invalid freshness information to be stale
ce9c58
-    var parts = header.trim().split(/\s*,\s*/); // TODO: lame parsing
ce9c58
+    var parts = header.trim().split(/,/);
ce9c58
     for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
ce9c58
         var _ref;
ce9c58
 
ce9c58
@@ -36,11 +36,11 @@ function parseCacheControl(header) {
ce9c58
 
ce9c58
         var part = _ref;
ce9c58
 
ce9c58
-        var _part$split = part.split(/\s*=\s*/, 2),
ce9c58
+        var _part$split = part.split(/=/, 2),
ce9c58
             k = _part$split[0],
ce9c58
             v = _part$split[1];
ce9c58
 
ce9c58
-        cc[k] = v === undefined ? true : v.replace(/^"|"$/g, ''); // TODO: lame unquoting
ce9c58
+        cc[k.trim()] = v === undefined ? true : v.trim().replace(/^"|"$/g, '');
ce9c58
     }
ce9c58
 
ce9c58
     return cc;
ce9c58
@@ -556,4 +556,4 @@ module.exports = function () {
ce9c58
     };
ce9c58
 
ce9c58
     return CachePolicy;
ce9c58
-}();
ce9c58
\ No newline at end of file
ce9c58
+}();
ce9c58
-- 
ce9c58
2.39.2
ce9c58