We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4fb4513 + d3a66f4 commit 7065213Copy full SHA for 7065213
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
@@ -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