Commit 6c6abf6e authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

URL-encode http headers

Refs: #5150
parent e589d3da
......@@ -378,11 +378,6 @@ class file_modify(_pithos_container):
def main(self, path_or_url):
super(self.__class__, self)._run(path_or_url)
if self['publish'] and self['unpublish']:
raise CLIInvalidArgument(
'Arguments %s and %s cannot be used together' % (
self.arguments['publish'].lvalue,
self.arguments['publish'].lvalue))
if self['no_permissions'] and (
self['uuid_for_read_permission'] or self[
'uuid_for_write_permission']):
......
......@@ -161,6 +161,12 @@ class RequestManager(Logged):
else:
sendlog.info('data size: 0%s' % plog)
def _encode_headers(self):
headers = self.headers
for k, v in self.headers.items():
headers[k] = quote(v)
self.headers = headers
def perform(self, conn):
"""
:param conn: (httplib connection object)
......@@ -168,6 +174,7 @@ class RequestManager(Logged):
:returns: (HTTPResponse)
"""
self.dump_log()
self._encode_headers()
conn.request(
method=str(self.method.upper()),
url=str(self.path),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment