mirror of
https://github.com/davidallendj/opaal.git
synced 2026-06-03 08:31:52 -06:00
Merge pull request #6 from cjh1/content-type
Set content type for JSON responses
This commit is contained in:
commit
8049aaff40
1 changed files with 3 additions and 0 deletions
|
|
@ -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))
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue