WebDAV PUT method: who creates the etag ?

703 views
Skip to first unread message

B Aerts

unread,
Feb 9, 2015, 2:35:59 PM2/9/15
to sabredav...@googlegroups.com
Hello list,

experimenting with WebDAV, I came across the following issue.

I run the same test against 2 SabreDAV implementations, one local (OwnCloud) and one remote (Fruux).
When performing a PUT on the remote server, the server returns a etag.
When performing a PUT on the local server, the server does not return an etag.

My question: in SabreDAV, who handles the generation of the etag ?
Is it the WebDAV server, who generates an extra response header to be sent?
Or is it delegated to the web server (etags being considered as HTTP-related) ?

For those interested in the request :

PUT /owncloud/remote.php/caldav/calendars/bertaerts/personal/bertaerts.ics HTTP/1.1 Authorization: Basic YmVydGFlcnRzOmF6ZXJ0eQ== User-Agent: PHP cURL Client Host: localhost Accept: */* Content-type: text/calendar; charset=utf-8 If-match: "215543f88ba673e9e22690677a51d5a0" Content-Length: 467 BEGIN:VCALENDAR VERSION:2.0 PRODID:-//kigkonsult.se//NONSGML kigkonsult.se iCalcreator 2.10.23// METHOD:PUBLISH X-WR-CALNAME:Calendar Sample X-WR-CALDESC:Calendar Description X-WR-RELCALID:NEQIU-4QH23-6MJ0T-F46Y2 X-WR-TIMEZONE:Europe/Brussels BEGIN:VEVENT UID:bertaerts@5QLAG-YWMSM-5HW5B-05JY5 DTSTAMP:20150209T192813Z DTSTART:20150209T202500 DTEND:20150209T222500 SUMMARY:generated iCal UID=bertaerts@5QLAG-YWMSM-5HW5B-05JY5 END:VEVENT END:VCALENDAR

HTTP-Response:
HTTP/1.1 401 Unauthorized
Date: Mon, 09 Feb 2015 19:28:13 GMT
Server: Apache/2.2.26 (Unix) DAV/2 PHP/5.4.30 mod_ssl/2.2.26 OpenSSL/0.9.8za
X-Powered-By: PHP/5.4.30
Set-Cookie: oc20e73f6762=89b4db2d13d9d9b68e7e9cea699aed7a; path=/owncloud; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: Sameorigin
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src *; font-src 'self' data:; media-src *
X-Robots-Tag: none
WWW-Authenticate: Basic realm="ownCloud"
Content-Length: 292
Content-Type: application/xml; charset=utf-8

HTTP/1.1 204 No Content Date: Mon, 09 Feb 2015 19:28:13 GMT Server: Apache/2.2.26 (Unix) DAV/2 PHP/5.4.30 mod_ssl/2.2.26 OpenSSL/0.9.8za X-Powered-By: PHP/5.4.30 Set-Cookie: oc20e73f6762=150955b7fb5dbd9406bbe77937aef5b5; path=/owncloud; HttpOnly Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff X-Frame-Options: Sameorigin Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src *; font-src 'self' data:; media-src * X-Robots-Tag: none Set-Cookie: oc20e73f6762=3bb0d0e70c3a0614323b553876366b74; path=/owncloud; HttpOnly Content-Length: 0 Content-Type: text/html
 
Regards,

Bert

Evert Pot

unread,
Feb 9, 2015, 2:41:14 PM2/9/15
to sabredav...@googlegroups.com
Hi!


On Monday, February 9, 2015 at 2:35:59 PM UTC-5, B Aerts wrote:
Hello list,

experimenting with WebDAV, I came across the following issue.

I run the same test against 2 SabreDAV implementations, one local (OwnCloud) and one remote (Fruux).
When performing a PUT on the remote server, the server returns a etag.
When performing a PUT on the local server, the server does not return an etag.

My question: in SabreDAV, who handles the generation of the etag ?
Is it the WebDAV server, who generates an extra response header to be sent?
Or is it delegated to the web server (etags being considered as HTTP-related) ?

SabreDAV handles sending back the etag.

However, it just provides an API to do this. If you use the 'default implementation', you will get etags for most (but not all!) PUT requests.
For the simple iCalendar object you sent, and etag should be sent back. However, this is up to owncloud to implement.

If you're not getting an etag for that PUT, I would recommend you report a bug at owncloud.

Evert

 

Bert Gmail

unread,
Feb 9, 2015, 3:00:31 PM2/9/15
to sabredav...@googlegroups.com

On 09/02/15 20:41, Evert Pot wrote:
Hi!

On Monday, February 9, 2015 at 2:35:59 PM UTC-5, B Aerts wrote:
Hello list,

experimenting with WebDAV, I came across the following issue.

I run the same test against 2 SabreDAV implementations, one local (OwnCloud) and one remote (Fruux).
When performing a PUT on the remote server, the server returns a etag.
When performing a PUT on the local server, the server does not return an etag.

My question: in SabreDAV, who handles the generation of the etag ?
Is it the WebDAV server, who generates an extra response header to be sent?
Or is it delegated to the web server (etags being considered as HTTP-related) ?

SabreDAV handles sending back the etag.

However, it just provides an API to do this. If you use the 'default implementation', you will get etags for most (but not all!) PUT requests.
For the simple iCalendar object you sent, and etag should be sent back. However, this is up to owncloud to implement.

If you're not getting an etag for that PUT, I would recommend you report a bug at owncloud.

Evert

 
Will do - just wanted to make sure that it wasn't a webserver issue (1 problem with 2 variables (webserver and WebDAV server) .

Thx !

Bert
 
--
You received this message because you are subscribed to the Google Groups "SabreDAV Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sabredav-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sabredav-discuss/1bab2572-ed43-4df7-8fd2-0e332ba98fae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages