From 0f1aa2b78e1c22da16a482aedae4ed9800830007 Mon Sep 17 00:00:00 2001 From: Shadab Zafar Date: Mon, 13 Jun 2016 13:02:13 +0530 Subject: Py3: fix http2 bytes issue --- netlib/http/http2/connections.py | 4 ++-- pathod/language/http2.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/netlib/http/http2/connections.py b/netlib/http/http2/connections.py index 8667d370..8f246feb 100644 --- a/netlib/http/http2/connections.py +++ b/netlib/http/http2/connections.py @@ -5,7 +5,7 @@ import time import hyperframe.frame from hpack.hpack import Encoder, Decoder -from netlib import utils +from netlib import utils, strutils from netlib.http import url import netlib.http.headers import netlib.http.response @@ -230,7 +230,7 @@ class HTTP2Protocol(object): headers = response.headers.copy() if ':status' not in headers: - headers.insert(0, b':status', str(response.status_code).encode('ascii')) + headers.insert(0, b':status', strutils.always_bytes(response.status_code)) if hasattr(response, 'stream_id'): stream_id = response.stream_id diff --git a/pathod/language/http2.py b/pathod/language/http2.py index ea4fcd27..2693446e 100644 --- a/pathod/language/http2.py +++ b/pathod/language/http2.py @@ -188,7 +188,7 @@ class Response(_HTTP2Message): body = body.string() resp = http.Response( - (2, 0), + b'HTTP/2.0', self.status_code.string(), b'', headers, -- cgit v1.2.3