File tree 1 file changed +5
-17
lines changed
1 file changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -191,20 +191,8 @@ def should_display_graphiql(self):
191
191
def request_wants_html ():
192
192
best = request .accept_mimetypes .best_match (["application/json" , "text/html" ])
193
193
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" )
194
+ return (
195
+ best == "text/html"
196
+ and request .accept_mimetypes [best ]
197
+ > request .accept_mimetypes ["application/json" ]
198
+ )
You can’t perform that action at this time.
0 commit comments