mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-13 20:57:25 +08:00
[utils] Use bytes-like objects as header values on Python 2
This commit is contained in:
parent
d8c89fb14e
commit
7706aa1b20
@ -866,6 +866,8 @@ class YoutubeDLHandler(compat_urllib_request.HTTPHandler):
|
||||
location_escaped = escape_url(location)
|
||||
if location != location_escaped:
|
||||
del resp.headers['Location']
|
||||
if sys.version_info < (3, 0):
|
||||
location_escaped = location_escaped.encode('utf-8')
|
||||
resp.headers['Location'] = location_escaped
|
||||
return resp
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user