Skip to content

Commit

Permalink
🎨 Proxy setting sometimes cancel requests #9725
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Nov 24, 2023
1 parent b1985ea commit 3c755b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/system/logoutAuth", model.LogoutAuth)
ginServer.Handle("GET", "/api/system/getCaptcha", model.GetCaptcha)
ginServer.Handle("POST", "/api/system/setUILayout", setUILayout) // 这里不加鉴权 After modifying the access authentication code on the browser side, the other side does not refresh https://github.com/siyuan-note/siyuan/issues/8028
ginServer.Handle("POST", "/api/system/getNetwork", getNetwork) // 启动时获取网络设置,不能加鉴权
ginServer.Handle("GET", "/snippets/*filepath", serveSnippets)

// 需要鉴权
Expand Down Expand Up @@ -63,6 +62,7 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/system/checkUpdate", model.CheckAuth, checkUpdate)
ginServer.Handle("POST", "/api/system/exportLog", model.CheckAuth, exportLog)
ginServer.Handle("POST", "/api/system/getChangelog", model.CheckAuth, getChangelog)
ginServer.Handle("POST", "/api/system/getNetwork", model.CheckAuth, getNetwork)

ginServer.Handle("POST", "/api/storage/setLocalStorage", model.CheckAuth, model.CheckReadonly, setLocalStorage)
ginServer.Handle("POST", "/api/storage/getLocalStorage", model.CheckAuth, getLocalStorage)
Expand Down
4 changes: 4 additions & 0 deletions kernel/model/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ func CheckAuth(c *gin.Context) {
c.Next()
return
}
if strings.HasPrefix(c.Request.RequestURI, "/api/system/getNetwork") {
c.Next()
return
}
}

// 通过 Cookie
Expand Down

0 comments on commit 3c755b1

Please sign in to comment.