fix pathod http2 response creation

This commit is contained in:
Maximilian Hils 2016-09-21 20:36:26 -07:00
parent 770936f1f9
commit f1d519d7c4
2 changed files with 3 additions and 3 deletions

View File

@ -189,7 +189,7 @@ class Response(_HTTP2Message):
resp = http.Response( resp = http.Response(
b'HTTP/2.0', b'HTTP/2.0',
self.status_code.string(), int(self.status_code.string()),
b'', b'',
headers, headers,
body, body,

View File

@ -6,7 +6,7 @@ import time
import hyperframe.frame import hyperframe.frame
from hpack.hpack import Encoder, Decoder from hpack.hpack import Encoder, Decoder
from netlib import utils, strutils from netlib import utils
from netlib.http import http2 from netlib.http import http2
import netlib.http.headers import netlib.http.headers
import netlib.http.response import netlib.http.response
@ -201,7 +201,7 @@ class HTTP2StateProtocol(object):
headers = response.headers.copy() headers = response.headers.copy()
if ':status' not in headers: if ':status' not in headers:
headers.insert(0, b':status', strutils.always_bytes(response.status_code)) headers.insert(0, b':status', str(response.status_code).encode())
if hasattr(response, 'stream_id'): if hasattr(response, 'stream_id'):
stream_id = response.stream_id stream_id = response.stream_id