From f1d519d7c4231513c868179abf0fbfbb9387e633 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Wed, 21 Sep 2016 20:36:26 -0700 Subject: fix pathod http2 response creation --- pathod/language/http2.py | 2 +- pathod/protocols/http2.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pathod/language/http2.py b/pathod/language/http2.py index c0313baa..519ee699 100644 --- a/pathod/language/http2.py +++ b/pathod/language/http2.py @@ -189,7 +189,7 @@ class Response(_HTTP2Message): resp = http.Response( b'HTTP/2.0', - self.status_code.string(), + int(self.status_code.string()), b'', headers, body, diff --git a/pathod/protocols/http2.py b/pathod/protocols/http2.py index a2aa91b4..7b162664 100644 --- a/pathod/protocols/http2.py +++ b/pathod/protocols/http2.py @@ -6,7 +6,7 @@ import time import hyperframe.frame from hpack.hpack import Encoder, Decoder -from netlib import utils, strutils +from netlib import utils from netlib.http import http2 import netlib.http.headers import netlib.http.response @@ -201,7 +201,7 @@ class HTTP2StateProtocol(object): headers = response.headers.copy() 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'): stream_id = response.stream_id -- cgit v1.2.3