From 3e0035e9083ae73800a40fc659d59048a24b67b6 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 3 Feb 2017 11:07:53 +1100 Subject: [PATCH] Make web status text/plain When I added the JSON targets in I3410a4e4efd649732747b0502d66d212f50fa1bb I also changed the text output mime-type to be application/text, which seemed to pair with application/json. But this means browsers prompt to download the file rather than display it, which is not the intention. Restore to text/plain. Change-Id: I6fa6597b2fcd05a4c33ba4932c966101daf98ecf --- nodepool/tests/test_webapp.py | 2 +- nodepool/webapp.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nodepool/tests/test_webapp.py b/nodepool/tests/test_webapp.py index 3038547b6..75be8e6aa 100644 --- a/nodepool/tests/test_webapp.py +++ b/nodepool/tests/test_webapp.py @@ -39,7 +39,7 @@ class TestWebApp(tests.DBTestCase): "http://localhost:%s/image-list" % port) f = urllib2.urlopen(req) self.assertEqual(f.info().getheader('Content-Type'), - 'application/text') + 'text/plain; charset=UTF-8') data = f.read() self.assertTrue('fake-image' in data) diff --git a/nodepool/webapp.py b/nodepool/webapp.py index 9da0cd5dc..288235563 100644 --- a/nodepool/webapp.py +++ b/nodepool/webapp.py @@ -93,7 +93,7 @@ class WebApp(threading.Thread): if request.path.endswith('.json'): content_type = 'application/json' else: - content_type = 'application/text' + content_type = 'text/plain' response = webob.Response(body=output, content_type=content_type)