From 2269c9db96119960c717e6f26e55bb9a521b6c3b Mon Sep 17 00:00:00 2001 From: paulfantom Date: Mon, 11 Oct 2021 13:44:09 +0200 Subject: [PATCH] route: allow HEAD operations Signed-off-by: paulfantom --- route/route.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/route/route.go b/route/route.go index cc05516c..e89fe7eb 100644 --- a/route/route.go +++ b/route/route.go @@ -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.