From a289828c6fcddcd576b871ec0f9ad85ffa4f19fe Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 21 Mar 2024 14:39:06 -0400 Subject: [PATCH] fix: add cors to /s5/account/pins --- api/s5/s5.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/s5/s5.go b/api/s5/s5.go index 7e236d7..f73a931 100644 --- a/api/s5/s5.go +++ b/api/s5/s5.go @@ -197,7 +197,9 @@ func (s *S5API) Routes() (*httprouter.Router, error) { "GET /s5/account": middleware.ApplyMiddlewares(s.accountInfo, middleware.ProxyMiddleware, authMw), "GET /s5/account/stats": middleware.ApplyMiddlewares(s.accountStats, middleware.ProxyMiddleware, authMw), "GET /s5/account/pins.bin": middleware.ApplyMiddlewares(s.accountPinsBinary, middleware.ProxyMiddleware, authMw), - "GET /s5/account/pins": middleware.ApplyMiddlewares(s.accountPins, middleware.ProxyMiddleware, authMw), + "GET /s5/account/pins": middleware.ApplyMiddlewares(s.accountPins, middleware.ProxyMiddleware, defaultCors.Handler, authMw), + + "OPTIONS /s5/account/pins": middleware.ApplyMiddlewares(corsOptionsHandler, middleware.ProxyMiddleware, defaultCors.Handler, authMw), // Upload API "POST /s5/upload": middleware.ApplyMiddlewares(s.smallFileUpload, middleware.ProxyMiddleware, defaultCors.Handler, authMw),