35 lines
1.5 KiB
Diff
35 lines
1.5 KiB
Diff
Index: node-v14.21.3/deps/npm/node_modules/http-cache-semantics/node4/index.js
|
|
===================================================================
|
|
--- node-v14.21.3.orig/deps/npm/node_modules/http-cache-semantics/node4/index.js
|
|
+++ node-v14.21.3/deps/npm/node_modules/http-cache-semantics/node4/index.js
|
|
@@ -21,7 +21,7 @@ function parseCacheControl(header) {
|
|
|
|
// 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),
|
|
// the directive's value is considered invalid. Caches are encouraged to consider responses that have invalid freshness information to be stale
|
|
- var parts = header.trim().split(/\s*,\s*/); // TODO: lame parsing
|
|
+ var parts = header.trim().split(/,/); // TODO: lame parsing
|
|
for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
|
var _ref;
|
|
|
|
@@ -36,11 +36,11 @@ function parseCacheControl(header) {
|
|
|
|
var part = _ref;
|
|
|
|
- var _part$split = part.split(/\s*=\s*/, 2),
|
|
+ var _part$split = part.split(/=/, 2),
|
|
k = _part$split[0],
|
|
v = _part$split[1];
|
|
|
|
- cc[k] = v === undefined ? true : v.replace(/^"|"$/g, ''); // TODO: lame unquoting
|
|
+ cc[k.trim()] = v === undefined ? true : v.trim().replace(/^"|"$/g, ''); // TODO: lame unquoting
|
|
}
|
|
|
|
return cc;
|
|
@@ -556,4 +556,4 @@ module.exports = function () {
|
|
};
|
|
|
|
return CachePolicy;
|
|
-}();
|
|
\ No newline at end of file
|
|
+}();
|