[mod_webdav] If-None-Match: * on non-existent

fix logic for If-None-Match: * test on non-existent entity
(regression in lighttpd 1.4.64)

If-None-Match: * should not fail on a non-existent entity,
as it may be used to make the request conditional on the
origin server having no current representation of the entity.
(see If-None-Match in RFC2616 and RFC7232)

(This logic had been changed in lighttpd 1.4.64 in
 commit 8a535e7e06
 when allowing bogus, non-'*' If-None-Match etags
 for non-existent entities to not-match (and pass the check)
master
Glenn Strauss 7 months ago
parent 669ae77fb8
commit 3cc1509015
  1. 3
      src/mod_webdav.c

@ -2340,8 +2340,7 @@ webdav_if_match_or_unmodified_since (request_st * const r, struct stat *st)
if (NULL != inm) {
if (NULL == st
? buffer_eq_slen(inm, CONST_STR_LEN("*"))
|| (errno != ENOENT && errno != ENOTDIR)
? (errno != ENOENT && errno != ENOTDIR)
: http_etag_matches(etagb, inm->ptr, 1))
return 412; /* Precondition Failed */
}

Loading…
Cancel
Save