This commit is contained in:
Maximilian Hils 2015-08-28 17:35:22 +02:00
parent c428578c83
commit dd317aa5d2
2 changed files with 4 additions and 2 deletions

View File

@ -19,6 +19,8 @@ import language.websockets
from . import utils, log from . import utils, log
import logging import logging
from netlib.http.http1 import HTTP1Protocol
logging.getLogger("hpack").setLevel(logging.WARNING) logging.getLogger("hpack").setLevel(logging.WARNING)
@ -284,7 +286,7 @@ class Pathoc(tcp.TCPClient):
self.sslinfo = None self.sslinfo = None
if self.ssl: if self.ssl:
try: try:
alpn_protos = [b'http1.1'] # TODO: move to a new HTTP1 protocol alpn_protos = [HTTP1Protocol.ALPN_PROTO_HTTP1]
if self.use_http2: if self.use_http2:
alpn_protos.append(http2.HTTP2Protocol.ALPN_PROTO_H2) alpn_protos.append(http2.HTTP2Protocol.ALPN_PROTO_H2)

View File

@ -290,7 +290,7 @@ class TestDaemonHTTP2(_TestDaemon):
c.connect() c.connect()
_, kwargs = c.convert_to_ssl.call_args _, kwargs = c.convert_to_ssl.call_args
assert set(kwargs['alpn_protos']) == set([b'http1.1', b'h2']) assert set(kwargs['alpn_protos']) == set([b'http/1.1', b'h2'])
def test_request(self): def test_request(self):
c = pathoc.Pathoc( c = pathoc.Pathoc(