only BeautifulSoup for finding encoding when it's a html-ish type
This commit is contained in:
parent
956cc86072
commit
72649a90c2
1 changed files with 1 additions and 1 deletions
|
@ -188,7 +188,7 @@ def _request(request_obj: Request) -> Response:
|
||||||
encoding = response.encoding or request_obj.fallback_encoding
|
encoding = response.encoding or request_obj.fallback_encoding
|
||||||
|
|
||||||
if (request_obj.detect_encoding and
|
if (request_obj.detect_encoding and
|
||||||
content_type and content_type in DECODE_CONTENT_TYPES):
|
content_type and content_type in SOUP_CONTENT_TYPES):
|
||||||
souped = bs4.BeautifulSoup(response.data, request_obj.parser)
|
souped = bs4.BeautifulSoup(response.data, request_obj.parser)
|
||||||
encoding = _find_encoding(souped) or encoding
|
encoding = _find_encoding(souped) or encoding
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue