diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2018-12-27 15:40:06 -0500 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-12-27 20:40:06 +0000 |
commit | 73fb98ce70b327d1236b9540f3839a89c5d22ef0 (patch) | |
tree | f6d7f1ddee052fd7bd0979f72a59c83fe000a1e0 /tools/http_server.py | |
parent | 3d9f46a6cfc14d890d9899fdd4df2cc993478cc0 (diff) |
Lazily create .mime files only with mismatch/no extension (#1417)
Diffstat (limited to 'tools/http_server.py')
-rwxr-xr-x | tools/http_server.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/http_server.py b/tools/http_server.py index 6cf997b86..7c4b1fe25 100755 --- a/tools/http_server.py +++ b/tools/http_server.py @@ -58,6 +58,12 @@ class ContentTypeHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): return "application/x-javascript" if "form_urlencoded" in path: return "application/x-www-form-urlencoded" + if "no_ext" in path: + return "text/typescript" + if "unknown_ext" in path: + return "text/typescript" + if "mismatch_ext" in path: + return "text/javascript" return SimpleHTTPServer.SimpleHTTPRequestHandler.guess_type(self, path) |