Skip to content

Commit 93c9aae

Browse files
committed
fix: correct error status code for URL path parsing failure
1 parent 722f6a4 commit 93c9aae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

route_push.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func routeDoPushV1(c *fiber.Ctx) error {
7676
// parse url path (highest priority)
7777
pathParams, err := extractUrlPathParams(c)
7878
if err != nil {
79-
return c.Status(500).JSON(failed(400, "url path parse failed: %v", err))
79+
return c.Status(400).JSON(failed(400, "url path parse failed: %v", err))
8080
}
8181
for key, val := range pathParams {
8282
params[key] = val
@@ -102,7 +102,7 @@ func routeDoPushV2(c *fiber.Ctx) error {
102102
// parse url path (highest priority)
103103
pathParams, err := extractUrlPathParams(c)
104104
if err != nil {
105-
return c.Status(500).JSON(failed(400, "url path parse failed: %v", err))
105+
return c.Status(400).JSON(failed(400, "url path parse failed: %v", err))
106106
}
107107
for key, val := range pathParams {
108108
params[key] = val

0 commit comments

Comments
 (0)