From 127df8b2a30e7f4bf972f485b8d535f27e5c6365 Mon Sep 17 00:00:00 2001 From: KF Date: Tue, 27 Aug 2019 21:46:14 -0500 Subject: [PATCH] * fixed broken mime types --- onionr/httpapi/miscclientapi/staticfiles.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/onionr/httpapi/miscclientapi/staticfiles.py b/onionr/httpapi/miscclientapi/staticfiles.py index d43d5b7f..3582ed24 100644 --- a/onionr/httpapi/miscclientapi/staticfiles.py +++ b/onionr/httpapi/miscclientapi/staticfiles.py @@ -18,8 +18,14 @@ along with this program. If not, see . ''' import os +import mimetypes from flask import Blueprint, send_from_directory +# Was having some mime type issues on windows, this appeared to fix it. +# we have no-sniff set, so if the mime types are invalid sripts can't load. +mimetypes.add_type('application/javascript', '.js') +mimetypes.add_type('text/css', '.css') + static_files_bp = Blueprint('staticfiles', __name__) root = os.getcwd() + '/static-data/www/' # should be set to onionr install directory from onionr startup