File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -48,9 +48,17 @@ def request_raw(method, url):
48
48
except ValueError :
49
49
proto , dummy , host = url .split ("/" , 2 )
50
50
path = ""
51
+
52
+ host_port = host .rsplit ("@" , 1 )[- 1 ]
53
+ try :
54
+ host , port = host_port .rsplit (":" , 1 )[- 1 ]
55
+ except ValueError :
56
+ host = host_port
57
+ port = 80
58
+
51
59
if proto != "http:" :
52
60
raise ValueError ("Unsupported protocol: " + proto )
53
- reader , writer = yield from asyncio .open_connection (host , 80 )
61
+ reader , writer = yield from asyncio .open_connection (host , port )
54
62
# Use protocol 1.0, because 1.1 always allows to use chunked transfer-encoding
55
63
# But explicitly set Connection: close, even though this should be default for 1.0,
56
64
# because some servers misbehave w/o it.
You can’t perform that action at this time.
0 commit comments