Skip to content

Commit 9dfe593

Browse files
committed
[api] fix status code bug after filesystem middleware
1 parent 85afc69 commit 9dfe593

File tree

1 file changed

+4
-2
lines changed
  • internal/sms-gateway/handlers

1 file changed

+4
-2
lines changed

internal/sms-gateway/handlers/root.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ func (h *rootHandler) Register(app *fiber.App) {
2626
Root: http.FS(swagger.Docs),
2727
PathPrefix: "docs",
2828
MaxAge: 1 * 24 * 60 * 60,
29-
}))
30-
// app.Static("/api", "api")
29+
}), func(c *fiber.Ctx) error {
30+
// The filesystem middleware set 404 status before next, so we need to override it
31+
return c.Status(fiber.StatusOK).Next()
32+
})
3133
}
3234

3335
func newRootHandler(healthHandler *healthHandler) *rootHandler {

0 commit comments

Comments
 (0)