cors

package
v3.1.13 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(app *core.Core, config ...Config) core.HandlerFunc

New 返回一个标准 CORS 中间件

Types

type Config

type Config struct {
	AllowOrigins     string // 例如: "http://localhost:3000"
	AllowHeaders     string // 默认为空,自动从请求中取
	AllowMethods     string // 默认为 "GET,POST,PUT,DELETE,OPTIONS"
	AllowCredentials bool   // 是否允许带 Cookie / Authorization
}

Jump to

Keyboard shortcuts

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