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

Commit 70fe07e

Browse files
author
Aviv Cohn
committed
HTTPConnection takes a None default value for headers, instaed of {}
The method than sets headers to {} if None was received.
1 parent 998aa02 commit 70fe07e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hyper/common/connection.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def __init__(self,
7676
self._host, self._port, **self._h1_kwargs
7777
)
7878

79-
def request(self, method, url, body=None, headers={}):
79+
def request(self, method, url, body=None, headers=None):
8080
"""
8181
This will send a request to the server using the HTTP request method
8282
``method`` and the selector ``url``. If the ``body`` argument is
@@ -93,6 +93,9 @@ def request(self, method, url, body=None, headers={}):
9393
:returns: A stream ID for the request, or ``None`` if the request is
9494
made over HTTP/1.1.
9595
"""
96+
97+
headers = headers or {}
98+
9699
try:
97100
return self._conn.request(
98101
method=method, url=url, body=body, headers=headers

0 commit comments

Comments
 (0)