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

Commit 5f5d763

Browse files
committed
Allow non-string headers.
1 parent 799e37e commit 5f5d763

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hyper/http20/hpack.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ def _to_bytes(string):
7777
"""
7878
Convert string to bytes.
7979
"""
80+
if not isinstance(string, (str, bytes)):
81+
string = str(string)
82+
8083
return string if isinstance(string, bytes) else string.encode('utf-8')
8184

8285

0 commit comments

Comments
 (0)