mirror of
https://github.com/volatiletech/authboss.git
synced 2025-07-17 01:32:24 +02:00
@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
|
|
||||||
### Fixed
|
### 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
|
- Fix LoadCurrentUser error handling, it was swallowing errors when users were
|
||||||
not logged in, changed to be consistent, now returns ErrUserNotFound just like
|
not logged in, changed to be consistent, now returns ErrUserNotFound just like
|
||||||
CurrentUser.
|
CurrentUser.
|
||||||
|
@ -2,6 +2,7 @@ package defaults
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/volatiletech/authboss"
|
"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 {
|
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
|
// Redirector for http requests
|
||||||
|
Reference in New Issue
Block a user