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

Commit

Permalink
fix GetPublishedFile: Remove first slash
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Cheong committed Aug 28, 2023
1 parent 4c4eb9c commit 2da3eb3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/handlers/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ func UploadFile(c *gin.Context) {
func GetPublishedFile(c *gin.Context) {
// Get slug and path from url
slug := c.Param("slug")
path := c.Param("path")
path := c.Param("path")[1:]

// Get site id from slug
site, err := publish.GetSlug(slug)
Expand Down
2 changes: 1 addition & 1 deletion cmd/obsidian-sync/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func main() {
publishAPI.POST("remove", handlers.RemoveFile)

publishedGroup := router.Group("/published")
publishedGroup.GET(":slug/:path", handlers.GetPublishedFile)
publishedGroup.GET(":slug/*path", handlers.GetPublishedFile)

router.GET("/", handlers.WsHandler)
router.GET("/ws", handlers.WsHandler)
Expand Down

0 comments on commit 2da3eb3

Please sign in to comment.