curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: --etag-save overwrites on status 304

From: Paul Gilmartin via curl-users <curl-users_at_lists.haxx.se>
Date: Mon, 2 Oct 2023 12:03:38 -0600

On 10/2/23 11:33:36, Timothe Litt via curl-users wrote:
>>
> Curl should write the ETag header received with the 304.  Is the server sending it?
>
It did not.

> If not, it's a server bug.
>
> Note RFC2616 REQUIRES ETag to be sent "if it would have been sent in a 200 response to the same request".
>
That's a weird contrafactual statement. The server could not have
"sent ... a 200 response to the same request" because the "if none
match would have required the 304. Should the RFC be amended?

I read <https://datatracker.ietf.org/doc/html/rfc2616#section-14.26>:
     ... the server SHOULD
    respond with a 304 (Not Modified) response, including the cache-
    related header fields (particularly ETag) of one of the entities that
    matched. ...

How does SHOULD differ from MUST?

> If the server is sending it, but curl isn't writing it to the --etag-save, it's a curl bug.

-- 
Thanks,
gil
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-10-02