Skip to content

Commit 6055185

Browse files
committed
fix: remove use of deprecated cgi module
1 parent d9fb1e5 commit 6055185

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graphql_server/sanic/graphqlview.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import asyncio
22
import copy
3-
from cgi import parse_header
43
from collections.abc import MutableMapping
54
from functools import partial
65
from typing import List
76

87
from graphql import GraphQLError, specified_rules
98
from graphql.pyutils import is_awaitable
109
from graphql.type.schema import GraphQLSchema
10+
from sanic.headers import parse_content_header
1111
from sanic.response import HTTPResponse, html
1212
from sanic.views import HTTPMethodView
1313

@@ -213,7 +213,7 @@ def get_mime_type(request):
213213
if "content-type" not in request.headers:
214214
return None
215215

216-
mime_type, _ = parse_header(request.headers["content-type"])
216+
mime_type, _ = parse_content_header(request.headers["content-type"])
217217
return mime_type
218218

219219
def should_display_graphiql(self, request):

0 commit comments

Comments
 (0)