Skip to content

Commit

Permalink
head + 404 is not error #43
Browse files Browse the repository at this point in the history
  • Loading branch information
imsamurai committed Dec 10, 2014
1 parent 9eceb6a commit 71ed787
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Model/Datasource/HttpSourceConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ public function request($request = array()) {

if (!$this->_Response) {
$response = false;
} elseif (!$this->_Response->isOk() && $request['method'] === HttpSource::HTTP_METHOD_CHECK) {
$response = false;
} elseif (!$this->_Response->isOk()) {
$this->_error = $this->_extractRemoteError();
$response = false;
Expand Down
28 changes: 27 additions & 1 deletion Test/Case/Model/Datasource/HttpSourceConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,9 @@ public function requestProvider() {
//set #1
array(
//request
array(),
array(
'method' => HttpSource::HTTP_METHOD_READ
),
//response
false,
//data
Expand Down Expand Up @@ -978,6 +980,30 @@ public function requestProvider() {
//authMethod
null
),
//set #8
array(
//request
array(
'method' => HttpSource::HTTP_METHOD_CHECK
),
//response
false,
//data
array(
'isOk' => false,
'data' => '',
'reasonPhrase' => '',
'Content-Type' => 'application/json',
'error' => '',
'noResponse' => false,
'requestRaw' => '',
'requestQuery' => '',
),
//config
array(),
//authMethod
null
),
);
}

Expand Down

0 comments on commit 71ed787

Please sign in to comment.