Py3: fix http2 bytes issue

This commit is contained in:
Shadab Zafar 2016-06-13 13:02:13 +05:30 committed by Thomas Kriechbaumer
parent 26fe7dc87d
commit 0f1aa2b78e
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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,