mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-08 09:10:09 +01:00
Merge pull request #6731 from dstftw/strict-http-response
[utils] Strict HTTP responses (Closes #6727)
This commit is contained in:
commit
b17ca9c945
@ -587,6 +587,11 @@ def __init__(self, downloaded, expected):
|
|||||||
|
|
||||||
|
|
||||||
def _create_http_connection(ydl_handler, http_class, is_https, *args, **kwargs):
|
def _create_http_connection(ydl_handler, http_class, is_https, *args, **kwargs):
|
||||||
|
# Working around python 2 bug (see http://bugs.python.org/issue17849) by limiting
|
||||||
|
# expected HTTP responses to meet HTTP/1.0 or later (see also
|
||||||
|
# https://github.com/rg3/youtube-dl/issues/6727)
|
||||||
|
if sys.version_info < (3, 0):
|
||||||
|
kwargs['strict'] = True
|
||||||
hc = http_class(*args, **kwargs)
|
hc = http_class(*args, **kwargs)
|
||||||
source_address = ydl_handler._params.get('source_address')
|
source_address = ydl_handler._params.get('source_address')
|
||||||
if source_address is not None:
|
if source_address is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user