🎨 尝试解决潜在的剪藏扩展请求跨域问题 https://github.com/siyuan-note/siyuan/issues/6907

This commit is contained in:
Liang Ding 2022-12-29 22:48:06 +08:00
parent 192679eedd
commit e06d774da0
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -474,6 +474,7 @@ func corsMiddleware() gin.HandlerFunc {
c.Header("Access-Control-Allow-Credentials", "true")
c.Header("Access-Control-Allow-Headers", "origin, Content-Length, Content-Type, Authorization")
c.Header("Access-Control-Allow-Methods", "GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS")
c.Header("Access-Control-Allow-Private-Network", "true")
if c.Request.Method == "OPTIONS" {
c.AbortWithStatus(204)