Py3: decode() input before creating new Header token

This commit is contained in:
Shadab Zafar 2016-06-05 23:03:31 +05:30 committed by Maximilian Hils
parent f5a6b295f7
commit da38ce2e6e
1 changed files with 4 additions and 4 deletions

View File

@ -205,8 +205,8 @@ class Response(_HTTPMessage):
if not get_header(i[0], self.headers):
tokens.append(
Header(
base.TokValueLiteral(i[0]),
base.TokValueLiteral(i[1]))
base.TokValueLiteral(i[0].decode()),
base.TokValueLiteral(i[1].decode()))
)
if not self.raw:
if not get_header("Content-Length", self.headers):
@ -314,8 +314,8 @@ class Request(_HTTPMessage):
if not get_header(i[0], self.headers):
tokens.append(
Header(
base.TokValueLiteral(i[0]),
base.TokValueLiteral(i[1])
base.TokValueLiteral(i[0].decode()),
base.TokValueLiteral(i[1].decode())
)
)
if not self.raw: