Skip to content

Commit

Permalink
route: allow HEAD operations (#332)
Browse files Browse the repository at this point in the history
Signed-off-by: paulfantom <pawel@krupa.net.pl>
  • Loading branch information
paulfantom committed Oct 11, 2021
1 parent c4fba80 commit 5a26535
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions route/route.go
Expand Up @@ -109,6 +109,11 @@ func (r *Router) Post(path string, h http.HandlerFunc) {
r.rtr.POST(r.prefix+path, r.handle(path, h))
}

// Head registers a new HEAD route.
func (r *Router) Head(path string, h http.HandlerFunc) {
r.rtr.HEAD(r.prefix+path, r.handle(path, h))
}

// Redirect takes an absolute path and sends an internal HTTP redirect for it,
// prefixed by the router's path prefix. Note that this method does not include
// functionality for handling relative paths or full URL redirects.
Expand Down

0 comments on commit 5a26535

Please sign in to comment.