]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/web/status.py
web: make t=json stats pages use text/plain, instead of leaving it at text/html
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / web / status.py
index 39a3e0f029daddad6d8bd39be30dce3a56e51531..c2d429efc9cce652a400d3e0c65970c05abc353d 100644 (file)
@@ -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