From 31799af52b96973e42abeb020d6227090b7ecb2c Mon Sep 17 00:00:00 2001 From: Herman Slatman Date: Tue, 26 Mar 2024 15:58:03 +0100 Subject: [PATCH] Return HTTP OK on CORS Options request --- command/oauth/cmd.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/command/oauth/cmd.go b/command/oauth/cmd.go index 949cdd819..4b3bcaaea 100644 --- a/command/oauth/cmd.go +++ b/command/oauth/cmd.go @@ -1090,6 +1090,12 @@ func (o *oauth) ServeHTTP(w http.ResponseWriter, req *http.Request) { return } + if req.Method == http.MethodOptions { + w.WriteHeader(http.StatusOK) + w.Write(nil) + return + } + q := req.URL.Query() errStr := q.Get("error") if errStr != "" {