Skip to content

Commit

Permalink
Merge pull request #1136 from smallstep/herman/fix-oauth-cors
Browse files Browse the repository at this point in the history
Return HTTP OK on CORS Options request
  • Loading branch information
hslatman committed Mar 26, 2024
2 parents 589416d + 9d1b9a0 commit 65f97a8
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
}

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

0 comments on commit 65f97a8

Please sign in to comment.