Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

silentThrow #23

Open
fratzinger opened this issue Apr 19, 2021 · 3 comments
Open

silentThrow #23

fratzinger opened this issue Apr 19, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@fratzinger
Copy link
Owner

Throwing Forbidden maybe should not be exposed, so maybe it's a better idea to set context.result = [] or context.result = undefined;

@fratzinger fratzinger added the enhancement New feature or request label Apr 19, 2021
@J3m5
Copy link

J3m5 commented Apr 19, 2021

I'm not sure about this, I'd prefer to know why I don't get any result rather than just get an empty response.
And I don't think it can cause a security issue.
This is why the Forbidden error has been created for IMHO.

@fratzinger
Copy link
Owner Author

Thanks for your thoughts! :) If I will add it, I would make it totally optional.
For most apps, I'm on your side! But for big apps with open access the Forbidden error could open the door for hackers. As a hacker, if the forbidden is thrown, you know, that there's at least something you maybe want to investigate more.

@J3m5
Copy link

J3m5 commented Apr 19, 2021

After reading the RFC 7231 Section 6.5.3, it seems totally acceptable.

A server that wishes to
make public why the request has been forbidden can describe that
reason in the response payload (if any).

An origin server that wishes to "hide" the current existence of a
forbidden target resource MAY instead respond with a status code of
404 (Not Found).

So yes, an option would be great ! 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants