mirror of
https://github.com/friendica/friendica
synced 2025-05-21 17:04:12 +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
|
@ -1358,7 +1358,7 @@ class DFRN
|
|||
return -9; // timed out
|
||||
}
|
||||
|
||||
if (($curl_stat == 503) && stristr($postResult->getHeader(), 'retry-after')) {
|
||||
if (($curl_stat == 503) && $postResult->inHeader('retry-after')) {
|
||||
return -10;
|
||||
}
|
||||
|
||||
|
@ -1453,7 +1453,7 @@ class DFRN
|
|||
return -9; // timed out
|
||||
}
|
||||
|
||||
if (($curl_stat == 503) && (stristr($postResult->getHeader(), 'retry-after'))) {
|
||||
if (($curl_stat == 503) && $postResult->inHeader('retry-after')) {
|
||||
return -10;
|
||||
}
|
||||
|
||||
|
|
|
@ -746,7 +746,8 @@ class OStatus
|
|||
|
||||
$xml = '';
|
||||
|
||||
if (stristr($curlResult->getHeader(), 'Content-Type: application/atom+xml')) {
|
||||
if ($curlResult->inHeader('Content-Type') &&
|
||||
stristr($curlResult->getHeader('Content-Type'), 'application/atom+xml')) {
|
||||
$xml = $curlResult->getBody();
|
||||
}
|
||||
|
||||
|
@ -939,7 +940,8 @@ class OStatus
|
|||
|
||||
$xml = '';
|
||||
|
||||
if (stristr($curlResult->getHeader(), 'Content-Type: application/atom+xml')) {
|
||||
if ($curlResult->inHeader('Content-Type') &&
|
||||
stristr($curlResult->getHeader('Content-Type'), 'application/atom+xml')) {
|
||||
Logger::log('Directly fetched XML for URI ' . $related_uri, Logger::DEBUG);
|
||||
$xml = $curlResult->getBody();
|
||||
}
|
||||
|
|
|
@ -215,7 +215,7 @@ class Salmon
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (($return_code == 503) && (stristr($postResult->getHeader(), 'retry-after'))) {
|
||||
if (($return_code == 503) && $postResult->inHeader('retry-after')) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue