Subject: Re: Weak validators in conditional requests

From: Mark Nottingham <[email-masked]>
Date: Wed, 3 Oct 2018 17:14:40 +1000

Eduard,

> On 4 Sep 2018, at 9:09 pm, Eduard Bagdasaryan <[email-masked]> wrote:
> 
> Yes, it is stated there, but only about If-Match and If-None-Match
> headers. What about If-Modified-Since, If-Unmodified-Since
> and If-Range?

In 723x, the strong vs. weak comparison function distinction is only defined for ETags, not for Last-Modified. The requirements on comparison for LM are defined here:
  https://httpwg.org/specs/rfc7232.html#lastmod.comparison

For If-Range, 7233 says:

"""
A server that evaluates an If-Range precondition MUST use the strong comparison function when comparing entity-tags (Section 2.3.2 of [RFC7232]) and MUST evaluate the condition as false if an HTTP-date validator is provided that is not a strong validator in the sense defined by Section 2.2.2 of [RFC7232]. 
"""

https://httpwg.org/specs/rfc7233.html#header.if-range

Cheers,

> 
> 
> On 04.09.2018 05:01, Mark Nottingham wrote:
>>> Could you please help with the following two questions:
>>> 
>>> 1. The old RFC 2616 has a MUST requirement:
>>> 
>>> 
>>>> A cache or origin server receiving a conditional request, other than
>>>> a full-body GET request, MUST use the strong comparison function to
>>>> evaluate the condition.
>>>> 
>>> But I have not found this (or equivalent) in HTTPbis. Is it deprecated?
>>> 
>> It's stated in the definition of each conditional header; see:
>>   
>> https://httpwg.org/specs/rfc7232.html#preconditions
> 

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

---

From: Eduard Bagdasaryan <[email-masked]>
Date: Thu, 4 Oct 2018 16:30:22 +0300

On 03.10.2018 10:14, Mark Nottingham wrote:
>> On 4 Sep 2018, at 9:09 pm, Eduard Bagdasaryan<[email-masked]>  wrote:
>>

Mark, thanks for your reply.

Let's concentrate on an simple example below I've
recently posted here. Clarifying it would help me a lot.

So, a proxy cached a response with two headers below:

[...]
Date: Tue, 15 Aug 2018 12:36:57 GMT
Last-Modified: Tue, 15 Aug 2018 12:36:27 GMT

According to the RFC7273 section 2.2.2 the LM validator is
weak, since the difference between these two fields is less
than 60 seconds.

Then a client sends a range GET request:

[...]
If-Unmodified-Since: Tue, 15 Aug 2018 12:36:27 GMT
Range: bytes=0-5

Can the proxy respond with 206 Partial Content answer?

Thank you,
Ed.