Lines 191-198
Link Here
|
191 |
if not headers: |
191 |
if not headers: |
192 |
headers = {} |
192 |
headers = {} |
193 |
headers["accept-encoding"] = "deflate, gzip, x-gzip" |
193 |
headers["accept-encoding"] = "deflate, gzip, x-gzip" |
|
|
194 |
|
195 |
# In twisted 13.1.0 the _parse() function was replaced by the _URI class |
196 |
if hasattr(client, '_parse'): |
197 |
scheme, host, port, path = client._parse(url) |
198 |
else: |
199 |
from twisted.web.client import _URI |
200 |
uri = _URI.fromBytes(url) |
201 |
scheme = uri.scheme |
202 |
host = uri.host |
203 |
port = uri.port |
204 |
path = uri.path |
194 |
|
205 |
|
195 |
scheme, host, port, path = client._parse(url) |
|
|
196 |
factory = HTTPDownloader(url, filename, callback, headers, force_filename, allow_compression) |
206 |
factory = HTTPDownloader(url, filename, callback, headers, force_filename, allow_compression) |
197 |
if scheme == "https": |
207 |
if scheme == "https": |
198 |
from twisted.internet import ssl |
208 |
from twisted.internet import ssl |