[wp-trac] [WordPress Trac] #39687: Request headers sent incorrectly from `WP_Http` to `Requests`
WordPress Trac
noreply at wordpress.org
Wed Jan 25 12:02:49 UTC 2017
#39687: Request headers sent incorrectly from `WP_Http` to `Requests`
--------------------------+-----------------------------
Reporter: flixos90 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: HTTP API | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
While having a closer look at Requests (and also the way it is used in
WP), I noticed something that appears to be a bug.
The `$headers` variable that is passed from `WP_Http::request()` to
`Requests::request()` is an array of `$key => $value` pairs where `$value`
may be an array itself in case multiple values for that header have been
passed to `WP_Http::request()`. However, the Requests library expects each
`$value` of the `$headers` array to always be a string, as it uses
`sprintf()` with it directly (the passed `$headers` array is sent through
`Requests::flatten()`).
This can cause issues when specifying multiple headers of the same name.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39687>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list