diff options
Diffstat (limited to 'src/PurpleCode/PCurl/PCurl.php')
-rw-r--r-- | src/PurpleCode/PCurl/PCurl.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/PurpleCode/PCurl/PCurl.php b/src/PurpleCode/PCurl/PCurl.php index bd0e5f4..cd442d0 100644 --- a/src/PurpleCode/PCurl/PCurl.php +++ b/src/PurpleCode/PCurl/PCurl.php @@ -104,13 +104,15 @@ class PCurl { throw new PCurlException($error);
}
- $header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
+ $headerSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
+ $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
+
curl_close($curl);
- $header = substr($response, 0, $header_size);
- $body = substr($response, $header_size);
+ $header = substr($response, 0, $headerSize);
+ $body = substr($response, $headerSize);
- return new PCurlResponse($header, $body);
+ return new PCurlResponse($header, $body, $httpCode);
}
/**
@@ -179,6 +181,7 @@ class PCurl { */
public function ignoreSSLCertificate($bool = true) {
$this->setOption(CURLOPT_SSL_VERIFYPEER, !$bool);
+ $this->setOption(CURLOPT_SSL_VERIFYHOST, 0);
return $this;
}
|