REST: ETag handling

Ralf Schlatterbeck <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
The current REST-API code uses ETag to prevent concurrent modifications.
I noticed that the ETag header has the etag in double quotes, i.e.
ETag: "....."
So naive usage of the header with
etag = r.header['ETag']
will fail because the resulting value includes quotes. The @etag value
in the json representation does *not* include quotes.
I think the quotes should be removed in the header, too.

Another question regarding ETag: The 'PUT' method is supposed to be
idempotent. Requiring an ETag kills this property: A second equivalent
PUT request where the change is already applied will fail because the
ETag doesn't match. Shouldn't we optionally allow a PUT without an ETag
and document that using an ETag will make the method non-idempotent?

Ralf
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  www:   http://www.runtux.com
Reichergasse 131, A-3411 Weidling       email: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.