fix: CORS on assets api (#3659)

This commit is contained in:
Livio Amstutz
2022-05-19 16:09:02 +02:00
committed by GitHub
parent a5cea82670
commit 0906c2d513
3 changed files with 17 additions and 6 deletions

View File

@@ -83,10 +83,10 @@ func NewHandler(commands *command.Commands, verifier *authz.TokenVerifier, authC
verifier.RegisterServer("Assets-API", "assets", AssetsService_AuthMethods)
router := mux.NewRouter()
router.Use(sentryhttp.New(sentryhttp.Options{}).Handle, http_mw.CORSInterceptor, instanceInterceptor)
router.Use(sentryhttp.New(sentryhttp.Options{}).Handle, instanceInterceptor)
RegisterRoutes(router, h)
router.PathPrefix("/{owner}").Methods("GET").HandlerFunc(DownloadHandleFunc(h, h.GetFile()))
return router
return http_util.CopyHeadersToContext(http_mw.CORSInterceptor(router))
}
func (h *Handler) GetFile() Downloader {