Skip to content

Commit

Permalink
fix: Change request header encoding from bytes to str
Browse files Browse the repository at this point in the history
  • Loading branch information
harrtho committed Dec 21, 2022
1 parent 1d89ad0 commit 7108611
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion workflow/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0b1
2.0.0b2
6 changes: 2 additions & 4 deletions workflow/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ def byte_dict(dic):
"""
if isinstance(dic, CaseInsensitiveDictionary):
dic2 = CaseInsensitiveDictionary()
dic2 = CaseInsensitiveDictionary() # pragma: no cover
else:
dic2 = {}

for k, v in dic.items():
if isinstance(k, str):
k = k.encode('utf-8')
Expand Down Expand Up @@ -557,9 +558,6 @@ def request(method, url, params=None, data=None, headers=None, cookies=None,
elif data and isinstance(data, dict):
data = urllib.parse.urlencode(byte_dict(data))

# Make sure everything is encoded text
headers = byte_dict(headers)

if isinstance(data, str):
data = data.encode('utf-8')

Expand Down

0 comments on commit 7108611

Please sign in to comment.