mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-22347: Update mimetypes.guess_type to allow proper parsing of URLs (GH-15522)
https://bugs.python.org/issue22347
This commit is contained in:
parent
6cd9666ce9
commit
87bd2071c7
4 changed files with 13 additions and 2 deletions
|
@ -114,7 +114,8 @@ class MimeTypes:
|
|||
but non-standard types.
|
||||
"""
|
||||
url = os.fspath(url)
|
||||
scheme, url = urllib.parse._splittype(url)
|
||||
p = urllib.parse.urlparse(url)
|
||||
scheme, url = p.scheme, p.path
|
||||
if scheme == 'data':
|
||||
# syntax of data URLs:
|
||||
# dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue