1
0
mirror of https://github.com/httpie/cli.git synced 2025-08-10 22:42:05 +02:00

Decode headers using utf-8 only if they are not str (#1020)

This commit is contained in:
Gian Ortiz
2021-01-13 17:45:56 -03:00
committed by GitHub
parent 44ae67685d
commit db685d58b5
2 changed files with 10 additions and 1 deletions

View File

@@ -77,7 +77,9 @@ class Session(BaseConfigDict):
if value is None:
continue # Ignore explicitly unset headers
value = value.decode('utf8')
if type(value) is not str:
value = value.decode('utf8')
if name.lower() == 'user-agent' and value.startswith('HTTPie/'):
continue