跨域响应头补充

This commit is contained in:
TsMask committed 2023-09-08 21:09:18 +08:00
1 parent 6fdc40eb5d
commit d870920485
2 files changed
+8 -5

No files matched your search

+3 -1
View File
@@ -48,10 +48,12 @@ func Cors(next http.Handler) http.Handler {
// 允许请求头
allowHeaders := []string{
"Accesstoken",
"Content-Type",
"operationtype",
}
w.Header().Set("Access-Control-Allow-Headers", strings.Join(allowHeaders, ","))
w.WriteHeader(500)
w.WriteHeader(204)
return
}