summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-10-17 19:30:09 +0000
committerGerrit Code Review <review@openstack.org>2018-10-17 19:30:09 +0000
commit674059187da983946aec65827fd591948466c6a6 (patch)
treedf412bae51b43285f3f63e4033a405f86f3056c0
parent7a475d03be5920a0c951d397c0f2c1af3c7974af (diff)
parent64904ea9c9d86729739bea1737bfb9320258afe1 (diff)
Merge "Do not use Accept.best_match"
-rw-r--r--glance/common/wsgi.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/glance/common/wsgi.py b/glance/common/wsgi.py
index 95d772a..7ccd76a 100644
--- a/glance/common/wsgi.py
+++ b/glance/common/wsgi.py
@@ -1027,8 +1027,10 @@ class Request(webob.Request):
1027 def best_match_content_type(self): 1027 def best_match_content_type(self):
1028 """Determine the requested response content-type.""" 1028 """Determine the requested response content-type."""
1029 supported = ('application/json',) 1029 supported = ('application/json',)
1030 bm = self.accept.best_match(supported) 1030 best_matches = self.accept.acceptable_offers(supported)
1031 return bm or 'application/json' 1031 if not best_matches:
1032 return 'application/json'
1033 return best_matches[0][0]
1032 1034
1033 def get_content_type(self, allowed_content_types): 1035 def get_content_type(self, allowed_content_types):
1034 """Determine content type of the request body.""" 1036 """Determine content type of the request body."""