mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-17 02:45:16 +02:00
Fix IHTTPResult::getHeader/s()
- Split functionality "getHeader()" and "getHeaders()" analog to IMessageInterface::getHeader/s() - Fix functionality at various places - Adapt CurlResultTest
This commit is contained in:
parent
fff94563d7
commit
933ea7c9ce
11 changed files with 96 additions and 28 deletions
|
@ -90,12 +90,13 @@ function parse_url_content(App $a)
|
|||
if ($curlResponse->isSuccess()) {
|
||||
// Convert the header fields into an array
|
||||
$hdrs = [];
|
||||
$h = explode("\n", $curlResponse->getHeader());
|
||||
$h = $curlResponse->getHeaders();
|
||||
foreach ($h as $l) {
|
||||
$header = array_map('trim', explode(':', trim($l), 2));
|
||||
if (count($header) == 2) {
|
||||
list($k, $v) = $header;
|
||||
$hdrs[$k] = $v;
|
||||
foreach ($l as $k => $v) {
|
||||
if (empty($hdrs[$k])) {
|
||||
$hdrs[$k] = $v;
|
||||
}
|
||||
$hdrs[$k] .= " " . $v;
|
||||
}
|
||||
}
|
||||
$type = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue