From 3bbfd8a19f20d19551bab037c4b15bb05a8031ce Mon Sep 17 00:00:00 2001 From: Ashesh Vashi Date: Mon, 16 May 2016 11:28:23 +0530 Subject: [PATCH] Loading the explain.js as 'application/javascript' On some older version of browser, it was considering it as HTML. Thanks Neel Patel for reporting. --- web/pgadmin/misc/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/pgadmin/misc/__init__.py b/web/pgadmin/misc/__init__.py index 91d867575..2081822a6 100644 --- a/web/pgadmin/misc/__init__.py +++ b/web/pgadmin/misc/__init__.py @@ -9,7 +9,8 @@ """A blueprint module providing utility functions for the application.""" -from flask import url_for, render_template +from flask import url_for, render_template, Response +from flask.ext.babel import gettext as _ import config from pgadmin.utils import PgAdminModule @@ -73,4 +74,10 @@ def explain_js(): Returns: javascript for the explain module """ - return render_template("explain/js/explain.js") + return Response( + response=render_template( + "explain/js/explain.js", _=_ + ), + status=200, + mimetype="application/javascript" + )