Skip to content

Commit fd8b2a4

Browse files
committed
fix: return 401 instead of 404 for disallowed public requests
Signed-off-by: rafi <refaei.shikho@hotmail.com>
1 parent d1e344f commit fd8b2a4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

middlewares/access_control_middlewares.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func DisallowPublicRequests(next echo.HandlerFunc) echo.HandlerFunc {
9999
return func(ctx shared.Context) error {
100100
if shared.IsPublicRequest(ctx) {
101101
slog.Warn("access denied for public request in DisallowPublicRequests middleware")
102-
return echo.NewHTTPError(404, "could not find resource")
102+
return echo.NewHTTPError(401, "this endpoint is not accessible for public requests")
103103
}
104104
return next(ctx)
105105
}

0 commit comments

Comments
 (0)