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

Commit 7ff93ff

Browse files
committed
Ignore port block.
1 parent 52ad691 commit 7ff93ff

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

hyper/contrib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def get_connection(self, host, port, scheme):
3434
"""
3535
secure = (scheme == 'https')
3636

37-
if port is None:
37+
if port is None: # pragma: no cover
3838
port = 80 if not secure else 443
3939

4040
try:

test.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#import logging
2+
#
3+
#logging.basicConfig(level=logging.DEBUG)
4+
from hyper.common.connection import HTTPConnection, HTTP20Connection
5+
print("HTTP/1.1")
6+
c = HTTPConnection('http2bin.org', 80)
7+
print(c.request('GET', '/get'))
8+
r = c.get_response()
9+
print(r.read())
10+
11+
print("HTTP/2")
12+
c = HTTPConnection('http2bin.org', 443)
13+
print(c.request('GET', '/get'))
14+
r = c.get_response()
15+
print(r.read())

0 commit comments

Comments
 (0)