From 609290ad163197911b469f1727d15da150c043cf Mon Sep 17 00:00:00 2001 From: nullun Date: Wed, 31 Jul 2024 16:35:27 +0100 Subject: [PATCH] gofmt and add comment to exported function --- daemon/algod/api/server/lib/middlewares/cors.go | 1 + daemon/kmd/api/cors.go | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/daemon/algod/api/server/lib/middlewares/cors.go b/daemon/algod/api/server/lib/middlewares/cors.go index 914e75cf47..c8b292703f 100644 --- a/daemon/algod/api/server/lib/middlewares/cors.go +++ b/daemon/algod/api/server/lib/middlewares/cors.go @@ -32,6 +32,7 @@ func MakeCORS(tokenHeader string) echo.MiddlewareFunc { }) } +// MakePNA constructs the Private Network Access middleware function func MakePNA() echo.MiddlewareFunc { return func(next echo.HandlerFunc) echo.HandlerFunc { return func(ctx echo.Context) error { diff --git a/daemon/kmd/api/cors.go b/daemon/kmd/api/cors.go index 953ab998da..0384de5306 100644 --- a/daemon/kmd/api/cors.go +++ b/daemon/kmd/api/cors.go @@ -57,6 +57,7 @@ func corsMiddleware(allowedOrigins []string) func(http.Handler) http.Handler { } } +// AllowPNA constructs the Private Network Access middleware function func AllowPNA() func(http.Handler) http.Handler { return func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -65,6 +66,6 @@ func AllowPNA() func(http.Handler) http.Handler { } next.ServeHTTP(w, r) - }) - } + }) + } }