Merge pull request #1203 from dhensby/restfulservice-improvements

BUG Fixing a couple of bugs in RestfulService
This commit is contained in:
Ingo Schommer 2013-03-12 15:54:52 -07:00
commit e486574b31

View File

@ -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);
} }
} }