From db8ce087947380904cfec744f698adc5fa6f55c2 Mon Sep 17 00:00:00 2001 From: niphlod Date: Sun, 13 Oct 2013 21:29:32 +0200 Subject: [PATCH] return the correct content-type for the graph --- applications/admin/controllers/appadmin.py | 2 +- applications/examples/controllers/appadmin.py | 2 +- applications/welcome/controllers/appadmin.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/admin/controllers/appadmin.py b/applications/admin/controllers/appadmin.py index 0924d61e..7afa5fb5 100644 --- a/applications/admin/controllers/appadmin.py +++ b/applications/admin/controllers/appadmin.py @@ -577,8 +577,8 @@ def bg_graph_model(): graph.add_edge(n1, n2, color="#4C4C4C", label='') graph.layout() - #return graph.draw(format='png', prog='dot') if not request.args: + response.headers['Content-Type'] = 'image/png' return graph.draw(format='png', prog='dot') else: response.headers['Content-Disposition']='attachment;filename=graph.%s'%request.args(0) diff --git a/applications/examples/controllers/appadmin.py b/applications/examples/controllers/appadmin.py index 0924d61e..7afa5fb5 100644 --- a/applications/examples/controllers/appadmin.py +++ b/applications/examples/controllers/appadmin.py @@ -577,8 +577,8 @@ def bg_graph_model(): graph.add_edge(n1, n2, color="#4C4C4C", label='') graph.layout() - #return graph.draw(format='png', prog='dot') if not request.args: + response.headers['Content-Type'] = 'image/png' return graph.draw(format='png', prog='dot') else: response.headers['Content-Disposition']='attachment;filename=graph.%s'%request.args(0) diff --git a/applications/welcome/controllers/appadmin.py b/applications/welcome/controllers/appadmin.py index 0924d61e..7afa5fb5 100644 --- a/applications/welcome/controllers/appadmin.py +++ b/applications/welcome/controllers/appadmin.py @@ -577,8 +577,8 @@ def bg_graph_model(): graph.add_edge(n1, n2, color="#4C4C4C", label='') graph.layout() - #return graph.draw(format='png', prog='dot') if not request.args: + response.headers['Content-Type'] = 'image/png' return graph.draw(format='png', prog='dot') else: response.headers['Content-Disposition']='attachment;filename=graph.%s'%request.args(0)