uaiohttpclient: Only http: protocol is supported, fail predictably for others.

pull/226/merge
Paul Sokolovsky 2014-12-08 16:35:41 +02:00
rodzic 16c57c50f4
commit 2d23c7f125
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -48,6 +48,8 @@ def request_raw(method, url):
except ValueError:
proto, dummy, host = url.split("/", 2)
path = ""
if proto != "http:":
raise ValueError("Unsupported protocol: " + proto)
reader, writer = yield from asyncio.open_connection(host, 80)
# Use protocol 1.0, because 1.1 always allows to use chunked transfer-encoding
# But explicitly set Connection: close, even though this should be default for 1.0,