add no cors config

This commit is contained in:
Xhofe
2021-12-25 16:44:32 +08:00
parent 91c2c21522
commit 36f07ee194
6 changed files with 23 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package controllers
import (
"github.com/Xhofe/alist/drivers/base"
"github.com/Xhofe/alist/model"
"github.com/Xhofe/alist/server/common"
"github.com/gin-gonic/gin"
@ -35,6 +36,12 @@ func GetSettingsPublic(c *gin.Context) {
common.ErrorResp(c, err, 400)
return
}
*settings = append(*settings, model.SettingItem{
Key: "no cors",
Value: base.GetNoCors(),
Description: "",
Type: "string",
})
common.SuccessResp(c, settings)
}

View File

@ -19,7 +19,7 @@ func InitIndex() {
index, err = public.Public.Open("index.html")
}
if err != nil {
log.Fatalf(err.Error())
//log.Fatalf(err.Error())
return
}
data, _ := ioutil.ReadAll(index)