uaiohttpclient: Add User-Agent to request, some sites don't like lack of it.

pull/226/merge
Paul Sokolovsky 2015-02-07 15:27:25 +02:00
rodzic 0976a44c57
commit 98eb9b8194
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -54,7 +54,7 @@ def request_raw(method, url):
# 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,
# because some servers misbehave w/o it.
query = "%s /%s HTTP/1.0\r\nHost: %s\r\nConnection: close\r\n\r\n" % (method, path, host)
query = "%s /%s HTTP/1.0\r\nHost: %s\r\nConnection: close\r\nUser-Agent: compat\r\n\r\n" % (method, path, host)
yield from writer.awrite(query.encode('latin-1'))
# yield from writer.aclose()
return reader