Skip to content

Commit 7bfb3d9

Browse files
authored
Merge branch 'main' into is_compact
2 parents 2b3e457 + 7065213 commit 7bfb3d9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/cryptojwt/utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import base64
2-
from binascii import unhexlify
3-
import cgi
42
import functools
53
import importlib
64
import json
75
import re
86
import struct
7+
import warnings
8+
from binascii import unhexlify
9+
from email.message import EmailMessage
910
from typing import List
1011
import warnings
1112

@@ -270,7 +271,9 @@ def httpc_params_loader(httpc_params):
270271

271272
def check_content_type(content_type, mime_type):
272273
"""Return True if the content type contains the MIME type"""
273-
mt, _ = cgi.parse_header(content_type)
274+
msg = EmailMessage()
275+
msg["content-type"] = content_type
276+
mt = msg.get_content_type()
274277
return mime_type == mt
275278

276279

0 commit comments

Comments
 (0)