Re: draft-ietf-httpbis-digest-headers: Digests and Conditional Requests

> On 30 Jun 2020, at 7:22 pm, Julian Reschke <julian.reschke@gmx.de> wrote:
> 
> Hi there,
> 
> I just noticed that RFC 4918 (WebDAV) and RFC 6920 (Naming Things with
> Hashes) give us the machinery to make request conditional on hashes.
> 
> Example (based on
> <https://greenbytes.de/tech/webdav/draft-ietf-httpbis-digest-headers-02.html#server-returns-full-representation-data>)
> 
>  PUT /x HTTP/1.1
>  Host: foo
>  If: <ni:///sha-256;X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=>
>  Content-Type: application/json
> 
>  {"hello": "world2"}
> 
> All that would be needed is s statement that servers that support both
> the Digest field and the If header field SHOULD consider the ni: URIs
> built from the hashes as "state tokens" as defined in RFC 4918, Section 3.

As I read it, that means you'll get a 412 when the hash matches. The opposite would be more useful (i.e., an analogy to If-None-Match with hashes) would be more useful for many cases...

Having said that, I think a more specific header field would be more likely to get traction -- e.g., If-Not-Hash: ... That might enable several interesting use cases. 

Cheers,


--
Mark Nottingham   https://www.mnot.net/

Received on Wednesday, 8 July 2020 06:46:41 UTC