commit 1f67eb7403e6000840c44ec702c406f177ea1942
Author: Samuel Merritt <email address hidden>
Date: Wed Feb 12 18:29:12 2014 -0800
Support If-[None-]Match for object HEAD, SLO, and DLO
I moved the checking of If-Match and If-None-Match out of the object
server's GET method and into swob so that everyone can use it. The
interface is similar to the Range handling; make a response with
conditional_response=True, and you get handing of If-Match and
If-None-Match.
Since the only users of conditional_response are object GET, object
HEAD, SLO, and DLO, this has the effect of adding support for If-Match
and If-None-Match to just the latter three places and nowhere
else. This makes object GET and HEAD consistent for any kind of
object, large or small.
This also fixes a bug where various conditional headers (If-*) were
passed through to the object server on segment requests, which could
cause segment requests to fail with a 304 or 412 response. Now only
certain headers are copied to the segment requests, and that doesn't
include the conditional ones, so they can't goof up the segment
retrieval.
Note that I moved SegmentedIterable to swift.common.request_helpers
because it sprouted a transitive dependency on swob, and leaving it in
utils caused a circular import.
Bonus fix: unified the handling of DiskFileQuarantined and
DiskFileNotFound in object server GET and HEAD. Now in either case, a
412 will be returned if the client said "If-Match: *". If not, the
response is a 404, just like before.
Reviewed: https:/ /review. openstack. org/73162 /git.openstack. org/cgit/ openstack/ swift/commit/ ?id=1f67eb7403e 6000840c44ec702 c406f177ea1942
Committed: https:/
Submitter: Jenkins
Branch: master
commit 1f67eb7403e6000 840c44ec702c406 f177ea1942
Author: Samuel Merritt <email address hidden>
Date: Wed Feb 12 18:29:12 2014 -0800
Support If-[None-]Match for object HEAD, SLO, and DLO
I moved the checking of If-Match and If-None-Match out of the object _response= True, and you get handing of If-Match and
server's GET method and into swob so that everyone can use it. The
interface is similar to the Range handling; make a response with
conditional
If-None-Match.
Since the only users of conditional_ response are object GET, object
HEAD, SLO, and DLO, this has the effect of adding support for If-Match
and If-None-Match to just the latter three places and nowhere
else. This makes object GET and HEAD consistent for any kind of
object, large or small.
This also fixes a bug where various conditional headers (If-*) were
passed through to the object server on segment requests, which could
cause segment requests to fail with a 304 or 412 response. Now only
certain headers are copied to the segment requests, and that doesn't
include the conditional ones, so they can't goof up the segment
retrieval.
Note that I moved SegmentedIterable to swift.common. request_ helpers
because it sprouted a transitive dependency on swob, and leaving it in
utils caused a circular import.
Bonus fix: unified the handling of DiskFileQuarantined and Found in object server GET and HEAD. Now in either case, a
DiskFileNot
412 will be returned if the client said "If-Match: *". If not, the
response is a 404, just like before.
Closes-Bug: 1279076
Closes-Bug: 1280022
Closes-Bug: 1280028
Change-Id: Id2ee78346244d5 16b980202e990aa 38ce6812de5