diff --git a/src/zeep/utils.py b/src/zeep/utils.py index 2118253e..e08cdcd0 100644 --- a/src/zeep/utils.py +++ b/src/zeep/utils.py @@ -1,4 +1,4 @@ -import cgi +from email.message import Message import inspect import typing @@ -90,5 +90,8 @@ def detect_soap_env(envelope): def get_media_type(value): """Parse a HTTP content-type header and return the media-type""" - main_value, parameters = cgi.parse_header(value) - return main_value.lower() + msg = Message() + msg['content-type'] = value + + return msg.get_content_type() +