mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 13:37:06 +01:00
[utils] Use bytes-like objects as header values on Python 2
This commit is contained in:
parent
54fb199681
commit
9a4aec8b7e
@ -866,6 +866,8 @@ def http_response(self, req, resp):
|
|||||||
location_escaped = escape_url(location)
|
location_escaped = escape_url(location)
|
||||||
if location != location_escaped:
|
if location != location_escaped:
|
||||||
del resp.headers['Location']
|
del resp.headers['Location']
|
||||||
|
if sys.version_info < (3, 0):
|
||||||
|
location_escaped = location_escaped.encode('utf-8')
|
||||||
resp.headers['Location'] = location_escaped
|
resp.headers['Location'] = location_escaped
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user