mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-04 20:00:17 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
3812929426
1 changed files with 7 additions and 0 deletions
|
|
@ -369,6 +369,13 @@ func servePublic(ginServer *gin.Engine) {
|
|||
func serveSnippets(ginServer *gin.Engine) {
|
||||
ginServer.Handle("GET", "/snippets/*filepath", model.CheckAuth, func(c *gin.Context) {
|
||||
filePath := strings.TrimPrefix(c.Request.URL.Path, "/snippets/")
|
||||
if !model.IsAdminRoleContext(c) {
|
||||
if "conf.json" == filePath {
|
||||
c.Status(http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
ext := filepath.Ext(filePath)
|
||||
name := strings.TrimSuffix(filePath, ext)
|
||||
confSnippets, err := model.LoadSnippets()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue