Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

Commit 2da3eb3

Browse files
author
Antonio Cheong
committed
fix GetPublishedFile: Remove first slash
1 parent 4c4eb9c commit 2da3eb3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

api/handlers/publish.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ func UploadFile(c *gin.Context) {
293293
func GetPublishedFile(c *gin.Context) {
294294
// Get slug and path from url
295295
slug := c.Param("slug")
296-
path := c.Param("path")
296+
path := c.Param("path")[1:]
297297

298298
// Get site id from slug
299299
site, err := publish.GetSlug(slug)

cmd/obsidian-sync/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func main() {
6666
publishAPI.POST("remove", handlers.RemoveFile)
6767

6868
publishedGroup := router.Group("/published")
69-
publishedGroup.GET(":slug/:path", handlers.GetPublishedFile)
69+
publishedGroup.GET(":slug/*path", handlers.GetPublishedFile)
7070

7171
router.GET("/", handlers.WsHandler)
7272
router.GET("/ws", handlers.WsHandler)

0 commit comments

Comments
 (0)