Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 9098b85

Browse files
committed
Move H2C_PROTOCOL declaration
1 parent d76543d commit 9098b85

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

hyper/http11/connection.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@
1111
import base64
1212

1313
from .response import HTTP11Response
14-
from ..tls import wrap_socket
14+
from ..tls import wrap_socket, H2C_PROTOCOL
1515
from ..common.bufsocket import BufferedSocket
1616
from ..common.exceptions import TLSUpgrade, HTTPUpgrade
1717
from ..common.headers import HTTPHeaderMap
1818
from ..common.util import to_bytestring
1919
from ..compat import bytes
2020

21-
from ..http20.connection import H2C_PROTOCOL
2221
from ..packages.hyperframe.frame import SettingsFrame
2322

2423
# We prefer pycohttpparser to the pure-Python interpretation

hyper/http20/connection.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Objects that build hyper's connection-level HTTP/2 abstraction.
77
"""
8-
from ..tls import wrap_socket, H2_NPN_PROTOCOLS
8+
from ..tls import wrap_socket, H2_NPN_PROTOCOLS, H2C_PROTOCOL
99
from ..common.exceptions import ConnectionResetError
1010
from ..common.bufsocket import BufferedSocket
1111
from ..common.headers import HTTPHeaderMap
@@ -25,8 +25,6 @@
2525
import logging
2626
import socket
2727

28-
H2C_PROTOCOL = 'h2c'
29-
3028
log = logging.getLogger(__name__)
3129

3230
class HTTP20Connection(object):

hyper/tls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
H2_NPN_PROTOCOLS = [NPN_PROTOCOL, 'h2-16', 'h2-15', 'h2-14']
1515
SUPPORTED_NPN_PROTOCOLS = H2_NPN_PROTOCOLS + ['http/1.1']
1616

17+
H2C_PROTOCOL = 'h2c'
1718

1819
# We have a singleton SSLContext object. There's no reason to be creating one
1920
# per connection.

0 commit comments

Comments
 (0)