r.R.Get(r.getPattern(pattern), Wrap(middlewares...))
}
+// Options delegate options method
+func (r *Route) Options(pattern string, h ...interface{}) {
+ var middlewares = r.getMiddlewares(h)
+ r.R.Options(r.getPattern(pattern), Wrap(middlewares...))
+}
+
+// GetOptions delegate get and options method
+func (r *Route) GetOptions(pattern string, h ...interface{}) {
+ var middlewares = r.getMiddlewares(h)
+ r.R.Get(r.getPattern(pattern), Wrap(middlewares...))
+ r.R.Options(r.getPattern(pattern), Wrap(middlewares...))
+}
+
+// PostOptions delegate post and options method
+func (r *Route) PostOptions(pattern string, h ...interface{}) {
+ var middlewares = r.getMiddlewares(h)
+ r.R.Post(r.getPattern(pattern), Wrap(middlewares...))
+ r.R.Options(r.getPattern(pattern), Wrap(middlewares...))
+}
+
// Head delegate head method
func (r *Route) Head(pattern string, h ...interface{}) {
var middlewares = r.getMiddlewares(h)
}, ignSignInAndCsrf, lfsServerEnabled)
m.Group("", func() {
- m.Post("/git-upload-pack", repo.ServiceUploadPack)
- m.Post("/git-receive-pack", repo.ServiceReceivePack)
- m.Get("/info/refs", repo.GetInfoRefs)
- m.Get("/HEAD", repo.GetTextFile("HEAD"))
- m.Get("/objects/info/alternates", repo.GetTextFile("objects/info/alternates"))
- m.Get("/objects/info/http-alternates", repo.GetTextFile("objects/info/http-alternates"))
- m.Get("/objects/info/packs", repo.GetInfoPacks)
- m.Get("/objects/info/{file:[^/]*}", repo.GetTextFile(""))
- m.Get("/objects/{head:[0-9a-f]{2}}/{hash:[0-9a-f]{38}}", repo.GetLooseObject)
- m.Get("/objects/pack/pack-{file:[0-9a-f]{40}}.pack", repo.GetPackFile)
- m.Get("/objects/pack/pack-{file:[0-9a-f]{40}}.idx", repo.GetIdxFile)
+ m.PostOptions("/git-upload-pack", repo.ServiceUploadPack)
+ m.PostOptions("/git-receive-pack", repo.ServiceReceivePack)
+ m.GetOptions("/info/refs", repo.GetInfoRefs)
+ m.GetOptions("/HEAD", repo.GetTextFile("HEAD"))
+ m.GetOptions("/objects/info/alternates", repo.GetTextFile("objects/info/alternates"))
+ m.GetOptions("/objects/info/http-alternates", repo.GetTextFile("objects/info/http-alternates"))
+ m.GetOptions("/objects/info/packs", repo.GetInfoPacks)
+ m.GetOptions("/objects/info/{file:[^/]*}", repo.GetTextFile(""))
+ m.GetOptions("/objects/{head:[0-9a-f]{2}}/{hash:[0-9a-f]{38}}", repo.GetLooseObject)
+ m.GetOptions("/objects/pack/pack-{file:[0-9a-f]{40}}.pack", repo.GetPackFile)
+ m.GetOptions("/objects/pack/pack-{file:[0-9a-f]{40}}.idx", repo.GetIdxFile)
}, ignSignInAndCsrf)
m.Head("/tasks/trigger", repo.TriggerTask)