[dl:http] improve HTML signature check (#7697)
https://github.com/mikf/gallery-dl/issues/7697#issuecomment-2990734451 ignore leading whitespace
This commit is contained in:
@@ -486,7 +486,8 @@ MIME_TYPES = {
|
||||
|
||||
|
||||
def _signature_html(s):
|
||||
return b"<!doctype html".startswith(s[:14].lower())
|
||||
s = s[:14].lstrip()
|
||||
return s and b"<!doctype html".startswith(s.lower())
|
||||
|
||||
|
||||
# https://en.wikipedia.org/wiki/List_of_file_signatures
|
||||
|
||||
Reference in New Issue
Block a user