diff options
| author | Bert JW Regeer <bertjw@regeer.org> | 2016-04-12 20:42:22 -0600 |
|---|---|---|
| committer | Bert JW Regeer <bertjw@regeer.org> | 2016-04-12 20:42:22 -0600 |
| commit | c57b44e38727af4ce93ea703dc63d65d2831ace4 (patch) | |
| tree | 3b298b36b17df0b4c4a74dddf959954927758405 | |
| parent | c6a950ba64743d18d1ac401bd135b1e83b68ba2d (diff) | |
| download | pyramid-c57b44e38727af4ce93ea703dc63d65d2831ace4.tar.gz pyramid-c57b44e38727af4ce93ea703dc63d65d2831ace4.tar.bz2 pyramid-c57b44e38727af4ce93ea703dc63d65d2831ace4.zip | |
For */* case, MIMEAccept picks first server offer
This means that to make "text/plain" the default, we need to
specifically make it the first thing we offer.
For anything else, since the server offers are all weighted equally, the
client order should be accepted.
| -rw-r--r-- | pyramid/httpexceptions.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pyramid/httpexceptions.py b/pyramid/httpexceptions.py index 213e4b980..422f2f27f 100644 --- a/pyramid/httpexceptions.py +++ b/pyramid/httpexceptions.py @@ -249,9 +249,9 @@ ${body}''') accept_value = environ.get('HTTP_ACCEPT', '') accept = MIMEAccept(accept_value) match = accept.best_match( - ['application/json', + ['text/plain', 'text/html', - 'text/plain'], default_match='text/plain') + 'application/json'], default_match='text/plain') if match == 'text/html': self.content_type = 'text/html' |
