From 6c68f8dd6ccb351861ba5cb4854ac1b309e1ed15 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Sun, 8 Jan 2017 17:27:57 +0100 Subject: [PATCH] Fix content type detection for options request --- src/Ui/UiRequest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Ui/UiRequest.py b/src/Ui/UiRequest.py index 14075071..af56941c 100644 --- a/src/Ui/UiRequest.py +++ b/src/Ui/UiRequest.py @@ -49,7 +49,10 @@ class UiRequest(object): path = re.sub("^http://", "/", path) # Remove begining http for chrome extension .bit access if self.env["REQUEST_METHOD"] == "OPTIONS": - content_type = self.getContentType(path) + if "/" not in path.strip("/"): + content_type = self.getContentType("index.html") + else: + content_type = self.getContentType(path) self.sendHeader(content_type=content_type) return ""