From: Brian Warner <warner@allmydata.com>
Date: Sat, 26 Jul 2008 00:24:27 +0000 (-0700)
Subject: web: make t=json stats pages use text/plain, instead of leaving it at text/html
X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/frontends/FOOURL?a=commitdiff_plain;h=f8221c2c66a610b9557c6607f3a84f8109b16acb;p=tahoe-lafs%2Ftahoe-lafs.git

web: make t=json stats pages use text/plain, instead of leaving it at text/html
---

diff --git a/src/allmydata/web/status.py b/src/allmydata/web/status.py
index 39a3e0f0..c2d429ef 100644
--- a/src/allmydata/web/status.py
+++ b/src/allmydata/web/status.py
@@ -892,6 +892,7 @@ class HelperStatus(rend.Page):
         return rend.Page.renderHTTP(self, ctx)
 
     def render_JSON(self, ctx):
+        inevow.IRequest(ctx).setHeader("content-type", "text/plain")
         try:
             h = IClient(ctx).getServiceNamed("helper")
         except KeyError:
@@ -937,6 +938,7 @@ class Statistics(rend.Page):
             stats = provider.get_stats()
         t = get_arg(inevow.IRequest(ctx), "t")
         if t == "json":
+            inevow.IRequest(ctx).setHeader("content-type", "text/plain")
             return simplejson.dumps(stats, indent=1)
         # is there a better way to provide 'data' to all rendering methods?
         self.original = stats