Skip to content

Commit 00a211e

Browse files
committed
Fix test
1 parent 5946ec5 commit 00a211e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

routers/web/web.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,9 @@ func RegisterRoutes(m *web.Route) {
13571357
m.Get("/objects/{head:[0-9a-f]{2}}/{hash:[0-9a-f]{38}}", repo.GetLooseObject)
13581358
m.Get("/objects/pack/pack-{file:[0-9a-f]{40}}.pack", repo.GetPackFile)
13591359
m.Get("/objects/pack/pack-{file:[0-9a-f]{40}}.idx", repo.GetIdxFile)
1360-
m.Options("/", func(ctx *context.Context) {}) // to ensure middlewares could handle options requests
1360+
m.Options("/*", func(ctx *context.Context) {
1361+
ctx.Resp.WriteHeader(http.StatusMethodNotAllowed)
1362+
}) // to ensure middlewares could handle options requests
13611363
}, repo.HTTPMustEnabled(), ignSignInAndCsrf, repo.HTTPCors(), context_service.UserAssignmentWeb())
13621364
})
13631365
})

0 commit comments

Comments
 (0)