Skip to content
This repository has been archived by the owner on Nov 23, 2019. It is now read-only.

Commit

Permalink
Change some line breakings
Browse files Browse the repository at this point in the history
  • Loading branch information
KostyaEsmukov committed May 10, 2017
1 parent 09cb9d5 commit f6be513
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
19 changes: 13 additions & 6 deletions hyper/http11/connection.py
Expand Up @@ -124,13 +124,19 @@ def connect(self):

if self.proxy_host and self.secure:
# Send http CONNECT method to a proxy and acquire the socket
sock = _create_tunnel(self.proxy_host, self.proxy_port,
self.host, self.port,
proxy_headers=self.proxy_headers)
sock = _create_tunnel(
self.proxy_host,
self.proxy_port,
self.host,
self.port,
proxy_headers=self.proxy_headers
)
elif self.proxy_host:
# Simple http proxy
sock = socket.create_connection((self.proxy_host,
self.proxy_port), 5)
sock = socket.create_connection(
(self.proxy_host, self.proxy_port),
5
)
else:
sock = socket.create_connection((self.host, self.port), 5)
proto = None
Expand Down Expand Up @@ -179,7 +185,8 @@ def request(self, method, url, body=None, headers=None):
# Append proxy headers.
if self.proxy_host and not self.secure:
headers.update(
self._headers_to_http_header_map(self.proxy_headers).items())
self._headers_to_http_header_map(self.proxy_headers).items()
)

if self._sock is None:
self.connect()
Expand Down
15 changes: 10 additions & 5 deletions hyper/http20/connection.py
Expand Up @@ -373,13 +373,18 @@ def connect(self):

if self.proxy_host and self.secure:
# Send http CONNECT method to a proxy and acquire the socket
sock = _create_tunnel(self.proxy_host, self.proxy_port,
self.host, self.port,
proxy_headers=self.proxy_headers)
sock = _create_tunnel(
self.proxy_host,
self.proxy_port,
self.host,
self.port,
proxy_headers=self.proxy_headers
)
elif self.proxy_host:
# Simple http proxy
sock = socket.create_connection((self.proxy_host,
self.proxy_port))
sock = socket.create_connection(
(self.proxy_host, self.proxy_port)
)
else:
sock = socket.create_connection((self.host, self.port))

Expand Down

0 comments on commit f6be513

Please sign in to comment.