Merge "Do not use Accept.best_match" into stable/rocky

This commit is contained in:
Zuul
2018-11-20 17:57:54 +00:00
committed by Gerrit Code Review

View File

@@ -1033,8 +1033,10 @@ class Request(webob.Request):
def best_match_content_type(self):
"""Determine the requested response content-type."""
supported = ('application/json',)
bm = self.accept.best_match(supported)
return bm or 'application/json'
best_matches = self.accept.acceptable_offers(supported)
if not best_matches:
return 'application/json'
return best_matches[0][0]
def get_content_type(self, allowed_content_types):
"""Determine content type of the request body."""