HTTP API: Update Requests.

Fixes an issue where you couldn't set a `Requests_Proxy_HTTP` object as a proxy setting.

See https://github.com/rmccue/Requests/pull/223.
See #37107, #33055.

git-svn-id: https://develop.svn.wordpress.org/trunk@38053 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
ocean90 2016-07-13 15:43:02 +00:00
parent 94da293e5f
commit 26758ec22f

View File

@ -323,7 +323,7 @@ class Requests {
* for Basic authentication * for Basic authentication
* (Requests_Auth|array|boolean, default: false) * (Requests_Auth|array|boolean, default: false)
* - `proxy`: Proxy details to use for proxy by-passing and authentication * - `proxy`: Proxy details to use for proxy by-passing and authentication
* (Requests_Proxy|array|boolean, default: false) * (Requests_Proxy|array|string|boolean, default: false)
* - `max_bytes`: Limit for the response body size. * - `max_bytes`: Limit for the response body size.
* (integer|boolean, default: false) * (integer|boolean, default: false)
* - `idn`: Enable IDN parsing * - `idn`: Enable IDN parsing
@ -575,7 +575,7 @@ class Requests {
$options['auth']->register($options['hooks']); $options['auth']->register($options['hooks']);
} }
if (!empty($options['proxy'])) { if (is_string($options['proxy']) || is_array($options['proxy'])) {
$options['proxy'] = new Requests_Proxy_HTTP($options['proxy']); $options['proxy'] = new Requests_Proxy_HTTP($options['proxy']);
} }
if ($options['proxy'] !== false) { if ($options['proxy'] !== false) {