Skip to content

Commit 4c872b6

Browse files
authored
Merge pull request #2034 from l3montree-dev/fix/public-request-unauthorized
fix: return 401 instead of 404 for disallowed public requests
2 parents 3d03b40 + fd8b2a4 commit 4c872b6

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)