From f6a17b2f5e493e44b94b6587d5bd072bb75a9539 Mon Sep 17 00:00:00 2001 From: Mathias Aschwanden Date: Tue, 26 Jun 2018 12:06:28 +0200 Subject: [PATCH] Daemon: Fix preflight CORS request handling --- lib/jsonrpc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/jsonrpc.py b/lib/jsonrpc.py index b48d25805..200b6e86e 100644 --- a/lib/jsonrpc.py +++ b/lib/jsonrpc.py @@ -58,6 +58,9 @@ class VerifyingJSONRPCServer(SimpleJSONRPCServer): # first, call the original implementation which returns # True if all OK so far if SimpleJSONRPCRequestHandler.parse_request(myself): + # Do not authenticate OPTIONS-requests + if myself.command.strip() == 'OPTIONS': + return True try: self.authenticate(myself.headers) return True