mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-03-10 07:33:35 +00:00
Properly calculate response code.
This commit is contained in:
parent
b3c2c9db3c
commit
9ff16853b2
@ -277,7 +277,10 @@ class CalDAVClient {
|
||||
|
||||
list( $this->httpResponseHeaders, $this->httpResponseBody ) = preg_split( '{\r?\n\r?\n}s', $response, 2 );
|
||||
if ( preg_match( '{Transfer-Encoding: chunked}i', $this->httpResponseHeaders ) ) $this->Unchunk();
|
||||
$this->httpResponseCode = intval(substr($this->httpResponseHeaders,0,3));
|
||||
if ( preg_match('/HTTP\/\d\.\d (\d{3})/', $this->httpResponseHeaders, $status) )
|
||||
$this->httpResponseCode = intval($status);
|
||||
else
|
||||
$this->httpResponseCode = 0;
|
||||
|
||||
$this->headers = array(); // reset the headers array for our next request
|
||||
$this->ParseResponse($this->httpResponseBody);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user