cors

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cors

type Cors struct{}

Cors 结构体

func NewCors

func NewCors() *Cors

NewCors 实例化

func (*Cors) StartCors

func (*Cors) StartCors(origin string, headers map[string]string) gin.HandlerFunc

StartCors 跨域请求处理

注意:仅适用于gin-gonic/gin框架,其余框架可参考实现

使用示例:

var r *gin.Engine

r.Use(cors.NewCors().StartCors("", nil))

Jump to

Keyboard shortcuts

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