Stop using application/x-javascript as a mime type and use the RFC-compliant application/javascript instead. Fixes #4261

This commit is contained in:
Dave Page 2019-05-15 09:44:57 +01:00
parent 020d9bb018
commit 4b421550d3
24 changed files with 33 additions and 32 deletions

View File

@ -17,4 +17,5 @@ Bug fixes
| `Bug #4164 <https://redmine.postgresql.org/issues/4164>`_ - Fix file browser path issue which occurs when client is on Windows and server is on Mac/Linux.
| `Bug #4218 <https://redmine.postgresql.org/issues/4218>`_ - Properly assign dropdownParent in Select2 controls.
| `Bug #4219 <https://redmine.postgresql.org/issues/4219>`_ - Ensure popper.js is installed when needed.
| `Bug #4246 <https://redmine.postgresql.org/issues/4246>`_ - Fixed console error when subnode control is used in panels.
| `Bug #4246 <https://redmine.postgresql.org/issues/4246>`_ - Fixed console error when subnode control is used in panels.
| `Bug #4261 <https://redmine.postgresql.org/issues/4261>`_ - Stop using application/x-javascript as a mime type and use the RFC-compliant application/javascript instead.

View File

@ -623,14 +623,14 @@ def utils():
pg_libpq_version=pg_libpq_version,
support_ssh_tunnel=config.SUPPORT_SSH_TUNNEL
),
200, {'Content-Type': 'application/x-javascript'})
200, {'Content-Type': 'application/javascript'})
@blueprint.route("/js/endpoints.js")
def exposed_urls():
return make_response(
render_template('browser/js/endpoints.js'),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
@ -639,7 +639,7 @@ def exposed_urls():
def error_js():
return make_response(
render_template('browser/js/error.js', _=gettext),
200, {'Content-Type': 'application/x-javascript'})
200, {'Content-Type': 'application/javascript'})
@blueprint.route("/js/node.js")
@ -659,14 +659,14 @@ def node_js():
edbas_help_path=edbas_help_path,
_=gettext
),
200, {'Content-Type': 'application/x-javascript'})
200, {'Content-Type': 'application/javascript'})
@blueprint.route("/js/messages.js")
def messages_js():
return make_response(
render_template('browser/js/messages.js', _=gettext),
200, {'Content-Type': 'application/x-javascript'})
200, {'Content-Type': 'application/javascript'})
@blueprint.route("/js/collection.js")
@ -674,7 +674,7 @@ def messages_js():
def collection_js():
return make_response(
render_template('browser/js/collection.js', _=gettext),
200, {'Content-Type': 'application/x-javascript'})
200, {'Content-Type': 'application/javascript'})
@blueprint.route("/browser.css")

View File

@ -930,7 +930,7 @@ class ServerNode(PGChildNodeView):
"servers/supported_servers.js",
server_types=ServerType.types()
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def connect_status(self, gid, sid):

View File

@ -206,7 +206,7 @@ class ForeignServerView(PGChildNodeView):
"foreign_servers/js/foreign_servers.js",
_=gettext
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(f):

View File

@ -223,7 +223,7 @@ class UserMappingView(PGChildNodeView):
"user_mappings/js/user_mappings.js",
_=gettext
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(f):

View File

@ -255,7 +255,7 @@ class DomainView(PGChildNodeView, DataTypeReader):
"domains/js/domains.js",
_=gettext
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(f):

View File

@ -328,7 +328,7 @@ class ForeignTableView(PGChildNodeView, DataTypeReader):
"foreign_tables/js/foreign_tables.js",
_=gettext
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(f):

View File

@ -224,7 +224,7 @@ class FtsConfigurationView(PGChildNodeView):
"fts_configuration/js/fts_configuration.js",
_=_
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(f):

View File

@ -212,7 +212,7 @@ class FtsDictionaryView(PGChildNodeView):
"fts_dictionary/js/fts_dictionary.js",
_=_
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(f):

View File

@ -207,7 +207,7 @@ class FtsTemplateView(PGChildNodeView):
"fts_template/js/fts_templates.js",
_=gettext
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(f):

View File

@ -313,7 +313,7 @@ class FunctionView(PGChildNodeView, DataTypeReader):
"function/js/functions.js",
_=gettext
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(f):
@ -1686,7 +1686,7 @@ class ProcedureView(FunctionView):
"procedure/js/procedures.js",
_=gettext
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
@ -1797,7 +1797,7 @@ class TriggerFunctionView(FunctionView):
"trigger_function/js/trigger_functions.js",
_=gettext
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)

View File

@ -121,7 +121,7 @@ class PackageView(PGChildNodeView):
"package/js/package.js",
_=_
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(action=None):

View File

@ -201,7 +201,7 @@ class EdbFuncView(PGChildNodeView, DataTypeReader):
"edbfunc/js/edbfunc.js",
_=gettext
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(f):
@ -709,7 +709,7 @@ class EdbProcView(EdbFuncView):
"edbproc/js/edbproc.js",
_=gettext
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)

View File

@ -175,7 +175,7 @@ class EdbVarView(PGChildNodeView, DataTypeReader):
"edbvar/js/edbvar.js",
_=gettext
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(f):

View File

@ -126,7 +126,7 @@ class SequenceView(PGChildNodeView):
"sequence/js/sequence.js",
_=_
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(action=None):

View File

@ -149,5 +149,5 @@ def module_js():
for n in ConstraintRegistry.registry
]
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)

View File

@ -196,7 +196,7 @@ class CheckConstraintView(PGChildNodeView):
"check_constraint/js/check_constraint.js",
_=_
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(f):

View File

@ -223,7 +223,7 @@ class ExclusionConstraintView(PGChildNodeView):
"exclusion_constraint/js/exclusion_constraint.js",
_=_
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(f):

View File

@ -233,7 +233,7 @@ class ForeignKeyConstraintView(PGChildNodeView):
"foreign_key/js/foreign_key.js",
_=_
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(f):

View File

@ -245,7 +245,7 @@ class IndexConstraintView(PGChildNodeView):
node_type=self.node_type,
node_label=self.node_label
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(f):

View File

@ -188,7 +188,7 @@ class RuleView(PGChildNodeView):
"rules/js/rules.js",
_=gettext
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(f):

View File

@ -219,7 +219,7 @@ class ResourceGroupView(NodeView):
"resource_groups/js/resource_groups.js",
_=gettext
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(f):

View File

@ -105,7 +105,7 @@ class TablespaceView(PGChildNodeView):
"tablespaces/js/tablespaces.js",
_=gettext
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def check_precondition(f):

View File

@ -298,7 +298,7 @@ class NodeView(with_metaclass(MethodViewType, View)):
flask.render_template(
"{0}/js/{0}.js".format(self.node_type)
),
200, {'Content-Type': 'application/x-javascript'}
200, {'Content-Type': 'application/javascript'}
)
def children(self, *args, **kwargs):