Skip to content

Commit

Permalink
web: fix header bleed (#1092)
Browse files Browse the repository at this point in the history
Resolves #1091
  • Loading branch information
maxpowa authored Jun 21, 2016
1 parent 20eda29 commit 4918f6a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sopel/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ def get(uri, timeout=20, headers=None, return_headers=False,
if headers is None:
headers = default_headers
else:
headers = default_headers.update(headers)
tmp = default_headers.copy()
headers = tmp.update(headers)
u = requests.get(uri, timeout=timeout, headers=headers, verify=verify_ssl)
bytes = u.content
u.close()
Expand Down Expand Up @@ -115,7 +116,8 @@ def head(uri, timeout=20, headers=None, verify_ssl=True):
if headers is None:
headers = default_headers
else:
headers = default_headers.update(headers)
tmp = default_headers.copy()
headers = tmp.update(headers)
u = requests.get(uri, timeout=timeout, headers=headers, verify=verify_ssl)
info = u.headers
u.close()
Expand Down Expand Up @@ -175,7 +177,8 @@ def get_urllib_object(uri, timeout, headers=None, verify_ssl=True, data=None):
if headers is None:
headers = default_headers
else:
headers = default_headers.update(headers)
tmp = default_headers.copy()
headers = tmp.update(headers)
if data is not None:
response = requests.post(uri, timeout=timeout, verify=verify_ssl,
data=data, headers=headers)
Expand Down

0 comments on commit 4918f6a

Please sign in to comment.