mirror of
https://github.com/volatiletech/authboss.git
synced 2025-02-15 14:03:17 +02:00
parent
dc5a3def97
commit
d84ea6fac5
@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix a bug where content-types like 'application/json;charset=utf-8' would
|
||||
not trigger api responses in the default responder.
|
||||
- Fix LoadCurrentUser error handling, it was swallowing errors when users were
|
||||
not logged in, changed to be consistent, now returns ErrUserNotFound just like
|
||||
CurrentUser.
|
||||
|
@ -2,6 +2,7 @@ package defaults
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/volatiletech/authboss"
|
||||
)
|
||||
@ -41,7 +42,7 @@ func (r *Responder) Respond(w http.ResponseWriter, req *http.Request, code int,
|
||||
}
|
||||
|
||||
func isAPIRequest(r *http.Request) bool {
|
||||
return r.Header.Get("Content-Type") == "application/json"
|
||||
return strings.HasPrefix(r.Header.Get("Content-Type"), "application/json")
|
||||
}
|
||||
|
||||
// Redirector for http requests
|
||||
|
Loading…
x
Reference in New Issue
Block a user