新增获取所有插件信息的API接口

This commit is contained in:
dexter
2022-06-07 19:12:02 +08:00
parent 8f86407c94
commit 86ca05b24c
6 changed files with 45 additions and 18 deletions

View File

@@ -68,13 +68,14 @@ func CORS(next http.HandlerFunc) http.HandlerFunc {
header := w.Header()
header.Set("Access-Control-Allow-Credentials", "true")
header.Set("Cross-Origin-Resource-Policy", "cross-origin")
header.Set("Access-Control-Allow-Headers", "Content-Type,Access-Token")
origin := r.Header["Origin"]
if len(origin) == 0 {
header.Set("Access-Control-Allow-Origin", "*")
} else {
header.Set("Access-Control-Allow-Origin", origin[0])
}
if next != nil {
if next != nil && r.Method != "OPTIONS" {
next.ServeHTTP(w, r)
}
})