From e6741b99ace14d598e324e35cd8cfedd0fe9a737 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Fri, 22 Dec 2023 22:31:46 +0800 Subject: [PATCH] make "/attachments/{uuid}" use CORS --- routers/web/web.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/web.go b/routers/web/web.go index 48119243d3a70..0a6e7bc291cfe 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -780,7 +780,7 @@ func registerRoutes(m *web.Route) { m.Group("", func() { m.Get("/{username}", user.UsernameSubRoute) - m.Get("/attachments/{uuid}", repo.GetAttachment) + m.Methods("GET, OPTIONS", "/attachments/{uuid}", optionsCorsHandler(), repo.GetAttachment) }, ignSignIn) m.Post("/{username}", reqSignIn, context_service.UserAssignmentWeb(), user.Action)