Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/cryptojwt/utils.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import base64
import cgi
import functools
import importlib
import json
import re
import struct
import warnings
from binascii import unhexlify
from email.message import EmailMessage
from typing import List

from cryptojwt.exception import BadSyntax
Expand Down Expand Up @@ -269,5 +269,7 @@ def httpc_params_loader(httpc_params):

def check_content_type(content_type, mime_type):
"""Return True if the content type contains the MIME type"""
mt, _ = cgi.parse_header(content_type)
msg = EmailMessage()
msg["content-type"] = content_type
mt = msg.get_content_type()
return mime_type == mt