Re: --etag-save overwrites on status 304
Timothe Litt via curl-users <[email protected]>
| Newsgroups | gmane.comp.web.curl.general |
|---|---|
| Message-ID | <[email protected]> |
On 02-Oct-23 13:17, Paul Gilmartin via curl-users wrote: > I have been in the habit of using the same file as --etag-save > and --etag-compare. This sort of works. However, in case of > HTTP/1.1 304 Not Modified my --etag-compare is overwritt4n by > an empty file and is ineffective for the next fetch. > > I have started making my --etag-save a temp file and renaming > it only on success. Is this the best approach? > > Would it be better if curl wrote to --etag-save only if an > ETag: header appears, or do some users depend on the current > behavior? > Curl should write the ETag header received with the 304. Is the server sending it? 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". If the server is sending it, but curl isn't writing it to the --etag-save, it's a curl bug. Timothe Litt ACM Distinguished Engineer -------------------------- This communication may not represent the ACM or my employer's views, if any, on the matters discussed. -- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users Etiquette: https://curl.se/mail/etiquette.html
OpenPGP_signature
(application/pgp-signature, 495 B) - not displayed