protect-endpoints: 404 instead of 403 for Scope
I know itβs not a documented use case, but it works and somehow returns 404 error instead of 403.
.service(
web::scope("/admin")
.service(index)
.service(users)
.guard(PermissionGuard::new(ROLE_ADMIN.to_string()))
);
Was checked on v3.0.0-beta.1
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 22 (22 by maintainers)
Commits related to this issue
- build(version): use `0.1.0` version (#7) — committed to DDtKey/protect-endpoints by DDtKey 7 months ago
I would like to add this, thanks π
I found out how
Guards
work, and I found the way to send whatever you want.Guard
just checks whether that service suits some conditions or not, and in that case just skips it. You can just make another service, with the same link, easy) Check it out. Is that enough?I will study this question a little later, and if possible, we will definitely do it at the library level. But at the moment, I do not know about such a possibility π
Would be great and very useful for newcomers.
This is good point π I think need to describe this behavior in the documentation and readme (regarding the response code) π€
I thought itβs the same, need to check