mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-11-26 06:37:07 +00:00
fix(api): serve per-package analytics for names with slashes
The route matched one path segment, so scoped npm names and Go module paths returned 404. It now takes the rest of the path as the name.
This commit is contained in:
@@ -88,7 +88,8 @@ func (a *App) handleAnalyticsPackageStats(c fiber.Ctx) error {
|
||||
c.Set("Content-Type", "application/json")
|
||||
|
||||
registry := c.Params("registry")
|
||||
name := c.Params("name")
|
||||
// The wildcard route carries names with slashes (@scope/pkg, Go module paths).
|
||||
name := c.Params("*")
|
||||
|
||||
if registry == "" || name == "" {
|
||||
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
|
||||
|
||||
Reference in New Issue
Block a user