feat: support CORS Private Network Access (#350)

This commit is contained in:
Mao Mao
2026-08-28 15:27:04 +02:00
committed by GitHub
parent 6dc4d8de20
commit 4733aa03c4
5 changed files with 43 additions and 13 deletions
+7 -6
View File
@@ -48,12 +48,13 @@ func NewHandler(c *Config) (http.Handler, error) {
if c.CORS.Enabled {
return cors.New(cors.Options{
AllowCredentials: c.CORS.Credentials,
AllowedOrigins: c.CORS.AllowedHosts,
AllowedMethods: c.CORS.AllowedMethods,
AllowedHeaders: c.CORS.AllowedHeaders,
ExposedHeaders: c.CORS.ExposedHeaders,
OptionsPassthrough: false,
AllowCredentials: c.CORS.Credentials,
AllowPrivateNetwork: c.CORS.AllowPrivateNetwork,
AllowedOrigins: c.CORS.AllowedHosts,
AllowedMethods: c.CORS.AllowedMethods,
AllowedHeaders: c.CORS.AllowedHeaders,
ExposedHeaders: c.CORS.ExposedHeaders,
OptionsPassthrough: false,
}).Handler(h), nil
}