We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2b3e457 + 7065213 commit 7bfb3d9Copy full SHA for 7bfb3d9
src/cryptojwt/utils.py
@@ -1,11 +1,12 @@
1
import base64
2
-from binascii import unhexlify
3
-import cgi
4
import functools
5
import importlib
6
import json
7
import re
8
import struct
+import warnings
+from binascii import unhexlify
9
+from email.message import EmailMessage
10
from typing import List
11
import warnings
12
@@ -270,7 +271,9 @@ def httpc_params_loader(httpc_params):
270
271
272
def check_content_type(content_type, mime_type):
273
"""Return True if the content type contains the MIME type"""
- mt, _ = cgi.parse_header(content_type)
274
+ msg = EmailMessage()
275
+ msg["content-type"] = content_type
276
+ mt = msg.get_content_type()
277
return mime_type == mt
278
279
0 commit comments