跨域响应头补充
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user