mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-06-30 00:19:25 +02:00
Merge pull request #1203 from dhensby/restfulservice-improvements
BUG Fixing a couple of bugs in RestfulService
This commit is contained in:
commit
e486574b31
|
@ -298,6 +298,8 @@ class RestfulService extends ViewableData {
|
||||||
protected function extractResponse($ch, $rawResponse) {
|
protected function extractResponse($ch, $rawResponse) {
|
||||||
//get the status code
|
//get the status code
|
||||||
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||||
|
//get a curl error if there is one
|
||||||
|
$curlError = curl_error($ch);
|
||||||
//normalise the status code
|
//normalise the status code
|
||||||
if(curl_error($ch) !== '' || $statusCode == 0) $statusCode = 500;
|
if(curl_error($ch) !== '' || $statusCode == 0) $statusCode = 500;
|
||||||
//calculate the length of the header and extract it
|
//calculate the length of the header and extract it
|
||||||
|
@ -588,7 +590,7 @@ class RestfulService_Response extends SS_HTTPResponse {
|
||||||
$this->cachedResponse = new RestfulService_Response($content);
|
$this->cachedResponse = new RestfulService_Response($content);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->cachedResponse->setBody = $content;
|
$this->cachedResponse->setBody($content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user