From 76818448e29c029f4524dd90bdc2d844b794326b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 10 May 2019 13:01:52 +0300 Subject: [PATCH] Ensure PIO Home mimetypes are known --- platformio/commands/home/command.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platformio/commands/home/command.py b/platformio/commands/home/command.py index 917187fb..d1b7d607 100644 --- a/platformio/commands/home/command.py +++ b/platformio/commands/home/command.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import mimetypes import socket from os.path import isdir @@ -58,6 +59,12 @@ def cli(port, host, no_open): contrib_dir = get_core_package_dir("contrib-piohome") if not isdir(contrib_dir): raise exception.PlatformioException("Invalid path to PIO Home Contrib") + + # Ensure PIO Home mimetypes are known + mimetypes.add_type("text/html", ".html") + mimetypes.add_type("text/css", ".css") + mimetypes.add_type("application/javascript", ".js") + root = WebRoot(contrib_dir) root.putChild(b"wsrpc", WebSocketResource(factory)) site = server.Site(root)