Skip to content

Commit

Permalink
jeff: update *Func methods to return HandlerFunc
Browse files Browse the repository at this point in the history
  • Loading branch information
abraithwaite committed Jan 13, 2019
1 parent 5a1a093 commit fea8d8d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sessions.go
Expand Up @@ -124,8 +124,8 @@ func (j *Jeff) Public(wrap http.Handler) http.Handler {
// PublicFunc wraps the given handler, adding the Session object (if there's an
// active session) to the request context before passing control to the next
// handler.
func (j *Jeff) PublicFunc(wrap http.HandlerFunc) http.Handler {
return j.wrap(wrap, wrap)
func (j *Jeff) PublicFunc(wrap http.HandlerFunc) http.HandlerFunc {
return j.wrap(wrap, wrap).ServeHTTP
}

// Wrap wraps the given handler, authenticating this route and calling the
Expand All @@ -136,8 +136,8 @@ func (j *Jeff) Wrap(wrap http.Handler) http.Handler {

// WrapFunc wraps the given handler, authenticating this route and calling the
// redirect handler if session is invalid.
func (j *Jeff) WrapFunc(wrap http.HandlerFunc) http.Handler {
return j.wrap(j.redir, wrap)
func (j *Jeff) WrapFunc(wrap http.HandlerFunc) http.HandlerFunc {
return j.wrap(j.redir, wrap).ServeHTTP
}

func (j *Jeff) wrap(redir, wrap http.Handler) http.Handler {
Expand Down

0 comments on commit fea8d8d

Please sign in to comment.