mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-01-27 00:33:34 +00:00
[sync-caldav] When we PUT the request, save the request/response headers.
We do a HEAD if we didn't get the ETag back from the PUT, but the server at the other end may have sent us a new location for the resource and we'll need to handle that at a higher level, so we make sure to preserve the original response from the PUT.
This commit is contained in:
parent
7ab8a3a3bb
commit
7edefc3b15
@ -401,11 +401,15 @@ class CalDAVClient {
|
||||
if ( preg_match( '{^ETag:\s+"([^"]*)"\s*$}im', $this->httpResponseHeaders, $matches ) ) $etag = $matches[1];
|
||||
if ( !isset($etag) || $etag == '' ) {
|
||||
printf( "No etag in:\n%s\n", $this->httpResponseHeaders );
|
||||
$save_request = $this->httpRequest;
|
||||
$save_response_headers = $this->httpResponseHeaders;
|
||||
$this->DoHEADRequest( $url );
|
||||
if ( preg_match( '{^Etag:\s+"([^"]*)"\s*$}im', $this->httpResponseHeaders, $matches ) ) $etag = $matches[1];
|
||||
if ( !isset($etag) || $etag == '' ) {
|
||||
printf( "Still No etag in:\n%s\n", $this->httpResponseHeaders );
|
||||
}
|
||||
$this->httpRequest = $save_request;
|
||||
$this->httpResponseHeaders = $save_response_headers;
|
||||
}
|
||||
return $etag;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user