Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 14d8487

Browse files
committed
Pass args and kwargs through in get_response.
1 parent ac2ecd4 commit 14d8487

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

hyper/common/connection.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class HTTPConnection(object):
2626
``'http2bin.org'``, ``'http2bin.org:443'`` or ``'127.0.0.1'``.
2727
:param port: (optional) The port to connect to. If not provided and one also
2828
isn't provided in the ``host`` parameter, defaults to 443.
29-
:param secure: (optional) Whether the request should use TLS.
29+
:param secure: (optional) Whether the request should use TLS.
3030
Defaults to ``False`` for most requests, but to ``True`` for any
3131
request issued to port 443.
3232
:param window_manager: (optional) The class to use to manage flow control
@@ -116,18 +116,18 @@ def request(self, method, url, body=None, headers={}):
116116
method=method, url=url, body=body, headers=headers
117117
)
118118

119-
def get_response(self):
119+
def get_response(self, *args, **kwargs):
120120
"""
121121
Returns a response object.
122122
"""
123123
try:
124-
return self._conn.get_response()
124+
return self._conn.get_response(*args, **kwargs)
125125
except HTTPUpgrade as e:
126-
# We upgraded via the HTTP Upgrade mechanism. We can just
127-
# go straight to the world of HTTP/2. Replace the backing object
126+
# We upgraded via the HTTP Upgrade mechanism. We can just
127+
# go straight to the world of HTTP/2. Replace the backing object
128128
# and insert the socket into it.
129129
assert e.negotiated == H2C_PROTOCOL
130-
130+
131131
self._conn = HTTP20Connection(
132132
self._host, self._port, **self._h2_kwargs
133133
)
@@ -139,7 +139,7 @@ def get_response(self):
139139

140140
# HTTP/2 preamble must be sent after receipt of a HTTP/1.1 101
141141
self._conn._send_preamble()
142-
142+
143143
return self._conn.get_response(1)
144144

145145
# The following two methods are the implementation of the context manager

0 commit comments

Comments
 (0)