diff --git a/pkg/internal/server/api/index.go b/pkg/internal/server/api/index.go index 38e2b95..c590dd5 100644 --- a/pkg/internal/server/api/index.go +++ b/pkg/internal/server/api/index.go @@ -19,7 +19,7 @@ func MapAPIs(app *fiber.App) { api := app.Group("/api").Name("API") { - api.Get("/links/:target", getLinkMeta) + api.Get("/links/*", getLinkMeta) api.Use(func(c *fiber.Ctx) error { if err := exts.EnsureAuthenticated(c); err != nil { diff --git a/pkg/internal/server/api/link_expander.go b/pkg/internal/server/api/link_expander.go index 1b58d39..6d9c193 100644 --- a/pkg/internal/server/api/link_expander.go +++ b/pkg/internal/server/api/link_expander.go @@ -10,8 +10,8 @@ import ( var inProgress sync.Map func getLinkMeta(c *fiber.Ctx) error { - targetEncoded := c.Params("target") - targetRaw, _ := base64.URLEncoding.DecodeString(targetEncoded) + targetEncoded := c.Params("*1") + targetRaw, _ := base64.StdEncoding.DecodeString(targetEncoded) if ch, loaded := inProgress.LoadOrStore(targetEncoded, make(chan struct{})); loaded { // If the request is already in progress, wait for it to complete diff --git a/pkg/internal/services/link_expander.go b/pkg/internal/services/link_expander.go index 3c3f4f3..e31bb80 100644 --- a/pkg/internal/services/link_expander.go +++ b/pkg/internal/services/link_expander.go @@ -96,7 +96,7 @@ func LinkExpand(target string) (*models.LinkMeta, error) { log.Debug().Str("url", target).Msg("Expanding link... analyzing") }) c.OnError(func(r *colly.Response, err error) { - log.Warn().Err(err).Str("url", target).Str("resp", string(r.Body)).Msg("Expanding link... failed") + log.Warn().Err(err).Str("url", target).Msg("Expanding link... failed") }) c.OnScraped(func(r *colly.Response) {