[utils] Fix getheader in urlhandle_detect_ext

Fixes #7049, related to #9440
pull/8/head
Yen Chi Hsuan 2016-05-15 15:32:54 +08:00
rodzic 69c9cc2716
commit 79298173c5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 3FDDD575826C5C30
1 zmienionych plików z 1 dodań i 5 usunięć

Wyświetl plik

@ -2031,11 +2031,7 @@ def mimetype2ext(mt):
def urlhandle_detect_ext(url_handle):
try:
url_handle.headers
getheader = lambda h: url_handle.headers[h]
except AttributeError: # Python < 3
getheader = url_handle.info().getheader
getheader = url_handle.headers.get
cd = getheader('Content-Disposition')
if cd: