Feat: read CORS config from file

This commit is contained in:
HFO4
2019-12-13 19:00:58 +08:00
parent c102c74d6d
commit ad02a659a6
5 changed files with 42 additions and 10 deletions

View File

@@ -34,6 +34,16 @@ var CaptchaConfig = &captcha{
CaptchaLen: 6,
}
// CORSConfig 跨域配置
var CORSConfig = &cors{
AllowAllOrigins: false,
AllowOrigins: []string{"UNSET"},
AllowMethods: []string{"PUT", "POST", "GET", "OPTIONS"},
AllowHeaders: []string{"Cookie", "Content-Length", "Content-Type", "X-Path", "X-FileName"},
AllowCredentials: true,
ExposeHeaders: nil,
}
var ThumbConfig = &thumb{
MaxWidth: 400,
MaxHeight: 300,