提交的内容
This commit is contained in:
9
vendor/rmccue/requests/src/Response/Headers.php
vendored
Executable file → Normal file
9
vendor/rmccue/requests/src/Response/Headers.php
vendored
Executable file → Normal file
@ -27,7 +27,7 @@ class Headers extends CaseInsensitiveDictionary {
|
||||
* Avoid using this where commas may be used unquoted in values, such as
|
||||
* Set-Cookie headers.
|
||||
*
|
||||
* @param string $offset
|
||||
* @param string $offset Name of the header to retrieve.
|
||||
* @return string|null Header value
|
||||
*/
|
||||
public function offsetGet($offset) {
|
||||
@ -69,7 +69,7 @@ class Headers extends CaseInsensitiveDictionary {
|
||||
/**
|
||||
* Get all values for a given header
|
||||
*
|
||||
* @param string $offset
|
||||
* @param string $offset Name of the header to retrieve.
|
||||
* @return array|null Header values
|
||||
*
|
||||
* @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not valid as an array key.
|
||||
@ -79,7 +79,10 @@ class Headers extends CaseInsensitiveDictionary {
|
||||
throw InvalidArgument::create(1, '$offset', 'string|int', gettype($offset));
|
||||
}
|
||||
|
||||
$offset = strtolower($offset);
|
||||
if (is_string($offset)) {
|
||||
$offset = strtolower($offset);
|
||||
}
|
||||
|
||||
if (!isset($this->data[$offset])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user