MultiHttpClient: Don't relay the end-of-headers line
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 19 Feb 2019 18:54:03 +0000 (13:54 -0500)
committerUmherirrender <umherirrender_de.wp@web.de>
Tue, 19 Feb 2019 21:20:30 +0000 (21:20 +0000)
commit8b89f8f37538ba64f9835ee454be21e580495647
treec6a124387ebb5595d21f219f623415860c1ac3a8
parent76e300f46cea939bccead85cd69f4f9d11681326
MultiHttpClient: Don't relay the end-of-headers line

The callback registered by CURLOPT_HEADERFUNCTION is called for the
empty line that separates the headers from the body, as well as all the
actual headers. In this case, the $header string will be "\r\n".

It turns out that HHVM ignores a call to header() when passed a string
that's empty after trimming whitespace, while Zend PHP only ignores the
call when the string is empty before trimming whitespace. This later
causes problems when headers_list() is used expecting all strings
returned to contain a colon.

Bug: T216086
Change-Id: I07937b17beb06788166266fbb1ea1bbf456761e3
includes/libs/MultiHttpClient.php