diff --git a/swift/common/bufferedhttp.py b/swift/common/bufferedhttp.py index fd1ef25bd0..7f6f4a9f49 100644 --- a/swift/common/bufferedhttp.py +++ b/swift/common/bufferedhttp.py @@ -135,7 +135,7 @@ def http_connect(ipaddr, port, device, partition, method, path, if query_string: path += '?' + query_string conn.path = path - conn.putrequest(method, path) + conn.putrequest(method, path, skip_host=(headers and 'Host' in headers)) if headers: for header, value in headers.iteritems(): conn.putheader(header, str(value)) @@ -168,7 +168,7 @@ def http_connect_raw(ipaddr, port, method, path, headers=None, if query_string: path += '?' + query_string conn.path = path - conn.putrequest(method, path) + conn.putrequest(method, path, skip_host=(headers and 'Host' in headers)) if headers: for header, value in headers.iteritems(): conn.putheader(header, str(value)) diff --git a/test/unit/common/test_bufferedhttp.py b/test/unit/common/test_bufferedhttp.py index ba58b374eb..ba0ab0e3a9 100644 --- a/test/unit/common/test_bufferedhttp.py +++ b/test/unit/common/test_bufferedhttp.py @@ -74,7 +74,7 @@ class TestBufferedHTTP(unittest.TestCase): def __init__(self, hostport): pass - def putrequest(self, method, path): + def putrequest(self, method, path, skip_host=0): pass def putheader(self, header, *values):