httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <>
Subject Broken If-Match handling and mod_dav
Date Sat, 01 Feb 2003 09:09:39 GMT

This bug states that a PUT with an If-Match condition to a mod_dav 
resource always fails.

The problem is that the set_headers mod_dav hook isn't necessarily 
called for dav_method_{put, post, etc, etc, etc}.  It is called for 
GET though when the special GET handling is enabled (see 
dav_method_get).  When we call ap_meets_condition in 
dav_validate_request for the PUT, we don't have an ETag header to 
satisfy the conditional request.  Therefore, PUT with If-Match always 
return a 412.

Calling the set_headers hook seems a bit bogus to me when that has 
nothing to do with the actual response.  I imagine we could fudge 
r->headers_out for the duration of ap_meets_condition and add the 
output of set_headers (which should contain ETag from the provider). 
(Hmm, the fact that mod_dav_fs doesn't implement set_headers may be 
harmful here.)

The problem here is that the output of set_headers indicates the 
original state of the resource, but by the time the request is over, 
we should probably have new resource state.  That leads me to a 
temporary r->headers_out, but it just seems wrong.

Another solution would be to set the ETag if it isn't there right 
before the ap_meets_conditions() call in dav_validate_resource using 
the getetag hook, and unset it if we set it temporarily.  But, ouch. 
(This does solve the mod_dav_fs problem though.)

Thoughts?  Is there another way?  -- justin

View raw message