Skip to content

Commit d922bcc

Browse files
committed
Don't know how this got unfixed.
2 parents e743102 + 7bfb3d9 commit d922bcc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cryptojwt/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import base64
2-
import cgi
32
import functools
43
import importlib
54
import json
65
import re
76
import struct
87
import warnings
98
from binascii import unhexlify
9+
from email.message import EmailMessage
1010
from typing import List
1111

1212
from cryptojwt.exception import BadSyntax
@@ -270,7 +270,9 @@ def httpc_params_loader(httpc_params):
270270

271271
def check_content_type(content_type, mime_type):
272272
"""Return True if the content type contains the MIME type"""
273-
mt, _ = cgi.parse_header(content_type)
273+
msg = EmailMessage()
274+
msg["content-type"] = content_type
275+
mt = msg.get_content_type()
274276
return mime_type == mt
275277

276278

0 commit comments

Comments
 (0)