Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Default ¶
func Default() wits.MiddlewareFunc
func New ¶
func New(cors Cors) wits.MiddlewareFunc
Types ¶
type Cors ¶
type Cors struct { AllowAllOrigins bool AllowOrigins []string AllowMethods []string AllowHeaders []string ExposeHeaders []string AllowCredentials bool MaxAge time.Duration }
Cors 跨域中间件,一般用于开发阶段 https://www.w3.org/TR/cors/
func DefaultConfig ¶
func DefaultConfig() Cors
func (*Cors) AddAllowHeaders ¶
func (*Cors) AddAllowMethods ¶
func (*Cors) AddAllowOrigins ¶
func (*Cors) AddExposeHeaders ¶
Click to show internal directories.
Click to hide internal directories.