cors

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllowedOrigins

func GetAllowedOrigins(corsConfig *corsv1.CORS) []string

GetAllowedOrigins exposes the configured origin list for logging.

func IsEnabled

func IsEnabled(corsConfig *corsv1.CORS) bool

IsEnabled reports whether the supplied CORS configuration is active.

func Middleware

func Middleware(corsConfig *corsv1.CORS) func(http.Handler) http.Handler

Middleware 创建 CORS 中间件。 corsConfig 应已经过 corsv1.CORS.ApplyDefaults()(由业务方在 bootstrap.ScanSections 时自动完成),本函数不再回填默认值。 当 corsConfig 为 nil 或 Enable=false 时返回透传中间件。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL