Merge "Block X-Backend* in gatekeeper"
This commit is contained in:
commit
d4a1d75bfc
@ -45,7 +45,8 @@ import re
|
||||
# rather than prefix match.
|
||||
inbound_exclusions = [get_sys_meta_prefix('account'),
|
||||
get_sys_meta_prefix('container'),
|
||||
get_sys_meta_prefix('object')]
|
||||
get_sys_meta_prefix('object'),
|
||||
'x-backend']
|
||||
# 'x-object-sysmeta' is reserved in anticipation of future support
|
||||
# for system metadata being applied to objects
|
||||
|
||||
|
@ -264,11 +264,6 @@ class Application(object):
|
||||
try:
|
||||
if self.memcache is None:
|
||||
self.memcache = cache_from_env(env)
|
||||
# Remove any x-backend-* headers since those are reserved for use
|
||||
# by backends communicating with each other; no end user should be
|
||||
# able to send those into the cluster.
|
||||
for key in list(k for k in env if k.startswith('HTTP_X_BACKEND_')):
|
||||
del env[key]
|
||||
req = self.update_request(Request(env))
|
||||
return self.handle_request(req)(env, start_response)
|
||||
except UnicodeError:
|
||||
|
@ -68,8 +68,13 @@ class TestGatekeeper(unittest.TestCase):
|
||||
'X-Container-Sysmeta-BAR': 'value',
|
||||
'X-Object-Sysmeta-BAR': 'value'}
|
||||
|
||||
forbidden_headers_out = dict(sysmeta_headers)
|
||||
forbidden_headers_in = dict(sysmeta_headers)
|
||||
x_backend_headers = {'X-Backend-Replication': 'true',
|
||||
'X-Backend-Replication-Headers': 'stuff'}
|
||||
|
||||
forbidden_headers_out = dict(sysmeta_headers.items() +
|
||||
x_backend_headers.items())
|
||||
forbidden_headers_in = dict(sysmeta_headers.items() +
|
||||
x_backend_headers.items())
|
||||
|
||||
def _assertHeadersEqual(self, expected, actual):
|
||||
for key in expected:
|
||||
|
Loading…
Reference in New Issue
Block a user