CORS默认允许的请求方法增加PATCH

This commit is contained in:
GoEdgeLab
2023-05-19 15:41:47 +08:00
parent 4932781221
commit b9a1a0b484

View File

@@ -1743,7 +1743,7 @@ func (this *HTTPRequest) processResponseHeaders(responseHeader http.Header, stat
// Allow-Methods
if len(corsConfig.AllowMethods) == 0 {
responseHeader.Set("Access-Control-Allow-Methods", "PUT, GET, POST, DELETE, HEAD, OPTIONS")
responseHeader.Set("Access-Control-Allow-Methods", "PUT, GET, POST, DELETE, HEAD, OPTIONS, PATCH")
} else {
responseHeader.Set("Access-Control-Allow-Methods", strings.Join(corsConfig.AllowMethods, ", "))
}