Merge pull request #6 from cjh1/content-type

Set content type for JSON responses
This commit is contained in:
David Allen 2026-01-15 14:12:57 -07:00 committed by GitHub
commit 8049aaff40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -137,6 +137,7 @@ func (s *Server) StartLogin(clients []oauth.Client, params ServerParams) error {
}
})
r.HandleFunc("/keys", func(w http.ResponseWriter, r *http.Request) {
var (
p = params.AuthProvider
jwks []byte
@ -182,6 +183,7 @@ func (s *Server) StartLogin(clients []oauth.Client, params ServerParams) error {
return
}
w.Header().Set("Content-Type", "application/json")
w.Write(jwks)
})
r.HandleFunc("/token", func(w http.ResponseWriter, r *http.Request) {
@ -217,6 +219,7 @@ func (s *Server) StartLogin(clients []oauth.Client, params ServerParams) error {
http.Redirect(w, r, "/error", http.StatusInternalServerError)
return
}
w.Header().Set("Content-Type", "application/json")
w.Write([]byte(accessToken))
}
})