Skip to content

Commit

Permalink
Merge pull request #139 from jschlyter/replace_cgi
Browse files Browse the repository at this point in the history
replace cgi
  • Loading branch information
jschlyter committed May 1, 2023
2 parents 4fb4513 + d3a66f4 commit 7065213
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit 7065213

Please sign in to comment.