We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
cgi
EmailMessage.get_content_type
1 parent 47c7415 commit 44be256Copy full SHA for 44be256
src/cryptojwt/utils.py
@@ -1,5 +1,5 @@
1
import base64
2
-import cgi
+from email.message import EmailMessage
3
import functools
4
import importlib
5
import json
@@ -269,5 +269,7 @@ def httpc_params_loader(httpc_params):
269
270
def check_content_type(content_type, mime_type):
271
"""Return True if the content type contains the MIME type"""
272
- mt, _ = cgi.parse_header(content_type)
+ msg = EmailMessage()
273
+ msg['content-type'] = content_type
274
+ mt = msg.get_content_type()
275
return mime_type == mt
0 commit comments