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

Commit 74fc0e5

Browse files
author
Aviv Cohn
committed
Default value for headers arg in HTTP20Connection.request() is None
instead of {}
1 parent 70fe07e commit 74fc0e5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hyper/http20/connection.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def __init_state(self):
144144

145145
return
146146

147-
def request(self, method, url, body=None, headers={}):
147+
def request(self, method, url, body=None, headers=None):
148148
"""
149149
This will send a request to the server using the HTTP request method
150150
``method`` and the selector ``url``. If the ``body`` argument is
@@ -160,6 +160,9 @@ def request(self, method, url, body=None, headers={}):
160160
:param headers: (optional) The headers to send on the request.
161161
:returns: A stream ID for the request.
162162
"""
163+
164+
headers = headers or {}
165+
163166
stream_id = self.putrequest(method, url)
164167

165168
default_headers = (':method', ':scheme', ':authority', ':path')

0 commit comments

Comments
 (0)