Loading the explain.js as 'application/javascript'

On some older version of browser, it was considering it as HTML.

Thanks Neel Patel for reporting.
This commit is contained in:
Ashesh Vashi 2016-05-16 11:28:23 +05:30
parent 28af92d386
commit 3bbfd8a19f

View File

@ -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"
)