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

Commit

Permalink
Merge pull request #217 from AvivC/development
Browse files Browse the repository at this point in the history
HTTPConnection takes a None default value for headers, instead of {}
  • Loading branch information
Lukasa committed Apr 8, 2016
2 parents 998aa02 + 70fe07e commit 062d15d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hyper/common/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self,
self._host, self._port, **self._h1_kwargs
)

def request(self, method, url, body=None, headers={}):
def request(self, method, url, body=None, headers=None):
"""
This will send a request to the server using the HTTP request method
``method`` and the selector ``url``. If the ``body`` argument is
Expand All @@ -93,6 +93,9 @@ def request(self, method, url, body=None, headers={}):
:returns: A stream ID for the request, or ``None`` if the request is
made over HTTP/1.1.
"""

headers = headers or {}

try:
return self._conn.request(
method=method, url=url, body=body, headers=headers
Expand Down

0 comments on commit 062d15d

Please sign in to comment.