Skip to content

Commit

Permalink
Return HTTP OK on CORS Options request
Browse files Browse the repository at this point in the history
  • Loading branch information
hslatman committed Mar 26, 2024
1 parent 9f9412c commit 9d1b9a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions command/oauth/cmd.go
Expand Up @@ -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

Check warning on line 1096 in command/oauth/cmd.go

View check run for this annotation

Codecov / codecov/patch

command/oauth/cmd.go#L1093-L1096

Added lines #L1093 - L1096 were not covered by tests
}

q := req.URL.Query()
errStr := q.Get("error")
if errStr != "" {
Expand Down

0 comments on commit 9d1b9a0

Please sign in to comment.