提交的内容
This commit is contained in:
8
vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php
vendored
Executable file → Normal file
8
vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php
vendored
Executable file → Normal file
@ -62,6 +62,10 @@ class SetCookie
|
||||
if (is_numeric($value)) {
|
||||
$data[$search] = (int) $value;
|
||||
}
|
||||
} elseif ($search === 'Secure' || $search === 'Discard' || $search === 'HttpOnly') {
|
||||
if ($value) {
|
||||
$data[$search] = true;
|
||||
}
|
||||
} else {
|
||||
$data[$search] = $value;
|
||||
}
|
||||
@ -420,7 +424,7 @@ class SetCookie
|
||||
}
|
||||
|
||||
// Remove the leading '.' as per spec in RFC 6265.
|
||||
// https://tools.ietf.org/html/rfc6265#section-5.2.3
|
||||
// https://datatracker.ietf.org/doc/html/rfc6265#section-5.2.3
|
||||
$cookieDomain = \ltrim(\strtolower($cookieDomain), '.');
|
||||
|
||||
$domain = \strtolower($domain);
|
||||
@ -431,7 +435,7 @@ class SetCookie
|
||||
}
|
||||
|
||||
// Matching the subdomain according to RFC 6265.
|
||||
// https://tools.ietf.org/html/rfc6265#section-5.1.3
|
||||
// https://datatracker.ietf.org/doc/html/rfc6265#section-5.1.3
|
||||
if (\filter_var($domain, \FILTER_VALIDATE_IP)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user