Skip to content

Commit

Permalink
CURL_OPT PUT Wasn't Doing PUT
Browse files Browse the repository at this point in the history
Performance impact, and although it appeared as a PUT, it wasn’t
sending data properly. Using CUSTOM_REQUEST instead.
  • Loading branch information
MichaelJ2324 committed Mar 23, 2017
1 parent c83d4ef commit a4bc1d8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/Request/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,6 @@ protected function configureHTTPMethod($method)
break;
case self::HTTP_POST:
return $this->addCurlOption(CURLOPT_POST, TRUE);
case self::HTTP_PUT:
return $this->addCurlOption(CURLOPT_PUT, TRUE);
default:
return $this->addCurlOption(CURLOPT_CUSTOMREQUEST, $method);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Request/AbstractRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ public function testCompileOptions(){

$Curl->setMethod(Curl::HTTP_PUT);
$CompiledOptions = $Curl->getCurlOptions();
$this->assertEquals(TRUE,$CompiledOptions[CURLOPT_PUT]);
$this->assertEquals(Curl::HTTP_PUT,$CompiledOptions[CURLOPT_CUSTOMREQUEST]);
$this->assertEquals($this->body,$CompiledOptions[CURLOPT_POSTFIELDS]);

$Curl->setMethod(Curl::HTTP_DELETE);
Expand Down

0 comments on commit a4bc1d8

Please sign in to comment.