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 e743102 + 7bfb3d9 commit d922bccCopy full SHA for d922bcc
src/cryptojwt/utils.py
@@ -1,12 +1,12 @@
1
import base64
2
-import cgi
3
import functools
4
import importlib
5
import json
6
import re
7
import struct
8
import warnings
9
from binascii import unhexlify
+from email.message import EmailMessage
10
from typing import List
11
12
from cryptojwt.exception import BadSyntax
@@ -270,7 +270,9 @@ def httpc_params_loader(httpc_params):
270
271
def check_content_type(content_type, mime_type):
272
"""Return True if the content type contains the MIME type"""
273
- mt, _ = cgi.parse_header(content_type)
+ msg = EmailMessage()
274
+ msg["content-type"] = content_type
275
+ mt = msg.get_content_type()
276
return mime_type == mt
277
278
0 commit comments