summaryrefslogtreecommitdiffstats
path: root/gluster/swift/common/Glusterfs.py
diff options
context:
space:
mode:
authorLuis Pabon <lpabon@redhat.com>2013-11-26 20:21:10 -0500
committerLuis Pabon <lpabon@redhat.com>2013-12-05 04:50:38 -0800
commitb36fe03702e76294d530d405ca61f45a7a382057 (patch)
tree4ccbd1199ef5ca6a81c8adf73c7b7f944f7ef2bd /gluster/swift/common/Glusterfs.py
parent0458016906c1cc0ce3e7b17e704d9da8a85aaec1 (diff)
Return BadRequest on X-Delete-At/After headers
Gluster-swift does not support X-Delete-After or X-Delete-At headers. The code needs to inform the caller with a 400-BadRequest if they use these headers. Change-Id: Ic9d3a1646c0d26bb0204245efce4501f7479fee6 Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/6364 Reviewed-by: Chetan Risbud <crisbud@redhat.com>
Diffstat (limited to 'gluster/swift/common/Glusterfs.py')
-rw-r--r--gluster/swift/common/Glusterfs.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/gluster/swift/common/Glusterfs.py b/gluster/swift/common/Glusterfs.py
index 55012d3..5d2cab1 100644
--- a/gluster/swift/common/Glusterfs.py
+++ b/gluster/swift/common/Glusterfs.py
@@ -37,6 +37,7 @@ _allow_mount_per_server = False
_implicit_dir_objects = False
_container_update_object_count = False
_account_update_container_count = False
+_ignore_unsupported_headers = False
if _fs_conf.read(os.path.join(SWIFT_DIR, 'fs.conf')):
try:
@@ -97,6 +98,19 @@ if _fs_conf.read(os.path.join(SWIFT_DIR, 'fs.conf')):
except (NoSectionError, NoOptionError):
pass
+ # -- Hidden configuration option --
+ # Ignore unsupported headers and allow them in a request without
+ # returning a 400-BadRequest. This setting can be set to
+ # allow unsupported headers such as X-Delete-At and
+ # X-Delete-After even though they will not be used.
+ try:
+ _ignore_unsupported_headers = \
+ _fs_conf.get('DEFAULT',
+ 'ignore_unsupported_headers',
+ "no") in TRUE_VALUES
+ except (NoSectionError, NoOptionError):
+ pass
+
NAME = 'glusterfs'