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