avancement planning
This commit is contained in:
+2
-1
@@ -20,7 +20,7 @@ var SEP_SEMICOLON = /\s*\x3B\s*/;
|
||||
var KEY_INDEX = 1; // index of key from COOKIE_PAIR match
|
||||
var VALUE_INDEX = 3; // index of value from COOKIE_PAIR match
|
||||
|
||||
// Returns a copy str trimmed and without trainling semicolon.
|
||||
// Returns a copy str trimmed and without trailing semicolon.
|
||||
function cleanCookieString(str) {
|
||||
return str.trim().replace(/\x3B+$/, '');
|
||||
}
|
||||
@@ -53,6 +53,7 @@ function parseSetCookieString(str) {
|
||||
// Each key represents the name of a cookie.
|
||||
function parseSetCookieHeader(header) {
|
||||
if (!header) return {};
|
||||
if (typeof header === 'string' || header instanceof String) header = header.split(';');
|
||||
header = Array.isArray(header) ? header : [header];
|
||||
|
||||
return header.reduce(function(res, str) {
|
||||
|
||||
Reference in New Issue
Block a user