From 5a265357f7c870751728f0b0901a724318001e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Krupa?= Date: Mon, 11 Oct 2021 13:50:19 +0200 Subject: [PATCH] route: allow HEAD operations (#332) 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.