diff --git a/swift/common/bufferedhttp.py b/swift/common/bufferedhttp.py index 58670a4860..00e58da756 100644 --- a/swift/common/bufferedhttp.py +++ b/swift/common/bufferedhttp.py @@ -126,27 +126,14 @@ def http_connect(ipaddr, port, device, partition, method, path, :param ssl: set True if SSL should be used (default: False) :returns: HTTPConnection object """ - if not port: - port = 443 if ssl else 80 - if ssl: - conn = HTTPSConnection('%s:%s' % (ipaddr, port)) - else: - conn = BufferedHTTPConnection('%s:%s' % (ipaddr, port)) if isinstance(path, unicode): try: path = path.encode("utf-8") except UnicodeError: pass # what should I do? path = quote('/' + device + '/' + str(partition) + path) - if query_string: - path += '?' + query_string - conn.path = 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)) - conn.endheaders() - return conn + return http_connect_raw( + ipaddr, port, method, path, headers, query_string, ssl) def http_connect_raw(ipaddr, port, method, path, headers=None,