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

Commit 425da1a

Browse files
author
Aviv Cohn
committed
HTTP11Connection.connect() takes headers=None default, not headers={}
Avoiding using a mutable object as a default value.
1 parent 74fc0e5 commit 425da1a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hyper/http11/connection.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def connect(self):
130130

131131
return
132132

133-
def request(self, method, url, body=None, headers={}):
133+
def request(self, method, url, body=None, headers=None):
134134
"""
135135
This will send a request to the server using the HTTP request method
136136
``method`` and the selector ``url``. If the ``body`` argument is
@@ -146,6 +146,9 @@ def request(self, method, url, body=None, headers={}):
146146
:param headers: (optional) The headers to send on the request.
147147
:returns: Nothing.
148148
"""
149+
150+
headers = headers or {}
151+
149152
method = to_bytestring(method)
150153
url = to_bytestring(url)
151154

0 commit comments

Comments
 (0)