mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2026-10-12 02:42:27 +07:00
node_modules: update (#344)
Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
1 parent
b099186883
commit
6e88c72525
63 files changed
+2863
-1227
No files matched your search
+18
-11
@@ -130,19 +130,31 @@ class Cookies {
|
||||
*/
|
||||
parse(cookieStr) {
|
||||
const cookie = {};
|
||||
let hasNameValue = false;
|
||||
(cookieStr || '')
|
||||
.toString()
|
||||
.split(';')
|
||||
.forEach(cookiePart => {
|
||||
const valueParts = cookiePart.split('=');
|
||||
const key = valueParts.shift().trim().toLowerCase();
|
||||
let value = valueParts.join('=').trim();
|
||||
let domain;
|
||||
if (!key) {
|
||||
if (!cookiePart.trim()) {
|
||||
// skip empty parts
|
||||
return;
|
||||
}
|
||||
switch (key) {
|
||||
const valueParts = cookiePart.split('=');
|
||||
const name = valueParts.shift().trim();
|
||||
let value = valueParts.join('=').trim();
|
||||
let domain;
|
||||
// the first part is always the name-value pair, so a cookie named
|
||||
// like an attribute is not mistaken for one (RFC 6265 section 5.2)
|
||||
if (!hasNameValue) {
|
||||
hasNameValue = true;
|
||||
if (name) {
|
||||
// cookie names are case-sensitive, only attribute names are not
|
||||
cookie.name = name;
|
||||
cookie.value = value;
|
||||
}
|
||||
return;
|
||||
}
|
||||
switch (name.toLowerCase()) {
|
||||
case 'expires': {
|
||||
const expires = new Date(value);
|
||||
// ignore date if can not parse it
|
||||
@@ -170,11 +182,6 @@ class Cookies {
|
||||
case 'httponly':
|
||||
cookie.httponly = true;
|
||||
break;
|
||||
default:
|
||||
if (!cookie.name) {
|
||||
cookie.name = key;
|
||||
cookie.value = value;
|
||||
}
|
||||
}
|
||||
});
|
||||
return cookie;
|
||||
|
||||
Reference in new issue
Block a user