swift/test/unit/common
Samuel Merritt 1f67eb7403 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.

Closes-Bug: 1279076
Closes-Bug: 1280022
Closes-Bug: 1280028

Change-Id: Id2ee78346244d516b980202e990aa38ce6812de5
2014-02-20 14:54:26 -08:00
..
middleware Support If-[None-]Match for object HEAD, SLO, and DLO 2014-02-20 14:54:26 -08:00
ring Use a tempfile.mkdtemp() based temporary directory 2014-01-19 16:29:45 -05:00
__init__.py Initial commit of Swift code 2010-07-12 17:03:45 -05:00
corrupted_example.db Real files for bad databases. 2011-08-02 18:21:25 +00:00
malformed_example.db Real files for bad databases. 2011-08-02 18:21:25 +00:00
test_bufferedhttp.py Change OpenStack LLC to Foundation 2013-09-20 01:02:31 +08:00
test_constraints.py Move all DLO functionality to middleware 2014-02-03 18:29:48 -08:00
test_container_sync_realms.py New container sync configuration option 2014-01-10 23:48:00 +00:00
test_daemon.py Revert "Refactor common/utils methods to common/ondisk" 2013-10-07 17:18:09 -04:00
test_db_replicator.py Increases the UT coverage of db_replicator.py 2013-12-03 14:00:22 -03:00
test_db.py Use a tempfile.mkdtemp() based temporary directory 2014-01-19 16:29:45 -05:00
test_direct_client.py Remove an useless dependency to swiftclient 2014-01-16 14:07:48 +01:00
test_exceptions.py Remove swiftclient dep on direct_client 2013-12-24 03:11:43 -08:00
test_internal_client.py Remove swiftclient dependency 2014-02-06 09:44:58 +00:00
test_manager.py Up nproc limit on startup. 2013-12-29 11:35:07 -05:00
test_memcached.py Attempt to make test_memcache_pool_timeout stable 2014-02-03 00:47:09 -05:00
test_request_helpers.py Generic means for persisting system metadata. 2014-01-06 22:29:37 +00:00
test_swob.py Support If-[None-]Match for object HEAD, SLO, and DLO 2014-02-20 14:54:26 -08:00
test_utils.py Merge "Add secondary groups to user during privilege escalation" 2014-01-28 00:37:49 +00:00
test_wsgi.py Move all DLO functionality to middleware 2014-02-03 18:29:48 -08:00