From 4e9801320c5b7a3094d5857c6854e9ff38f6702e Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Mon, 25 Jan 2016 23:50:23 +0100 Subject: [PATCH] Support OPTIONS method in route package. --- route/route.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/route/route.go b/route/route.go index 1c41b03af..fb337077a 100644 --- a/route/route.go +++ b/route/route.go @@ -75,6 +75,11 @@ func (r *Router) Get(path string, h http.HandlerFunc) { r.rtr.GET(r.prefix+path, handle(h)) } +// Options registers a new OPTIONS route. +func (r *Router) Options(path string, h http.HandlerFunc) { + r.rtr.OPTIONS(r.prefix+path, handle(h)) +} + // Del registers a new DELETE route. func (r *Router) Del(path string, h http.HandlerFunc) { r.rtr.DELETE(r.prefix+path, handle(h))