Skip to content

Commit f9d1b0e

Browse files
authored
Merge pull request #4 from database-playground/pan93412/dbp-19-set-access-control-max-age-86400-in-backend
fix: add access-control-max-age header
2 parents de718b8 + 9c7bc31 commit f9d1b0e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmd/backend/dependencies.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"log/slog"
88
"net/http"
9+
"time"
910

1011
"entgo.io/contrib/entgql"
1112
"github.com/99designs/gqlgen/graphql/handler"
@@ -80,6 +81,7 @@ func GinEngine(services []httpapi.Service, authStorage auth.Storage, gqlgenHandl
8081
AllowMethods: []string{"GET", "POST", "OPTIONS"},
8182
AllowHeaders: []string{"Content-Type", "User-Agent", "Referer"},
8283
AllowCredentials: true,
84+
MaxAge: 24 * time.Hour,
8385
}))
8486

8587
router := engine.Group("/")

0 commit comments

Comments
 (0)