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
a60ca4a1cf
commit
dee1899628
10 changed files with 89 additions and 22 deletions
|
@ -985,7 +985,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -735,7 +735,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();
|
||||
}
|
||||
|
||||
|
@ -928,7 +929,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