Skip to content

AlexZ33/goweb-cors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goweb-cors

Cross-origin_resource_sharing util for golang

What is CORS ?

CORS请求保护不当可导致敏感信息泄漏,因此应当严格设置Access-Control-Allow-Origin使用同源策略进行保护。

c := cors.New(cors.Options{
	AllowedOrigins:   []string{"http://qq.com", "https://qq.com"},
	AllowCredentials: true,
	Debug:            false,
})

// 引入中间件
handler = c.Handler(handler)

About

Cross-origin_resource_sharing util for golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages