From f5e17f5eaddc729bf2b4391b5d1832428f9e9958 Mon Sep 17 00:00:00 2001 From: jobe Date: Thu, 22 Sep 2022 17:28:47 +0200 Subject: [PATCH] Enhanced options for preflight requests regarding CORS. --- raspend/http.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/raspend/http.py b/raspend/http.py index 7bd285b..00c0586 100644 --- a/raspend/http.py +++ b/raspend/http.py @@ -30,8 +30,8 @@ def do_OPTIONS(self): """ self.send_response(200) self.send_header('Access-Control-Allow-Origin', '*') - self.send_header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS') - self.send_header("Access-Control-Allow-Headers", "X-Requested-With, Content-Type") + self.send_header('Access-Control-Allow-Methods', 'POST, GET, OPTIONS, PUT, DELETE') + self.send_header("Access-Control-Allow-Headers", 'Origin, Content-Type, Accept, Authorization, X-Request-With') self.end_headers() return