File tree 1 file changed +5
-18
lines changed
1 file changed +5
-18
lines changed Original file line number Diff line number Diff line change 1
1
import copy
2
- import sys
3
2
from collections .abc import MutableMapping
4
3
from functools import partial
5
4
from typing import List
@@ -191,20 +190,8 @@ def should_display_graphiql(self):
191
190
def request_wants_html ():
192
191
best = request .accept_mimetypes .best_match (["application/json" , "text/html" ])
193
192
194
- # Needed as this was introduced at Quart 0.8.0: https://gitlab.com/pgjones/quart/-/issues/189
195
- def _quality (accept , key : str ) -> float :
196
- for option in accept .options :
197
- if accept ._values_match (key , option .value ):
198
- return option .quality
199
- return 0.0
200
-
201
- if sys .version_info >= (3 , 7 ):
202
- return (
203
- best == "text/html"
204
- and request .accept_mimetypes [best ]
205
- > request .accept_mimetypes ["application/json" ]
206
- )
207
- else :
208
- return best == "text/html" and _quality (
209
- request .accept_mimetypes , best
210
- ) > _quality (request .accept_mimetypes , "application/json" )
193
+ return (
194
+ best == "text/html"
195
+ and request .accept_mimetypes [best ]
196
+ > request .accept_mimetypes ["application/json" ]
197
+ )
You can’t perform that action at this time.
0 commit comments