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

StaticHandler setAlwaysAsyncFS(true),if it can't find a file,it throw a exception rather than 404 error #231

Closed
gaoweiqiao opened this issue Oct 21, 2015 · 0 comments
Assignees
Labels

Comments

@gaoweiqiao
Copy link

When router.get(STATIC_URL).handler(StaticHandler.create().setAlwaysAsyncFS(true));
If it can't find a file, it throws a java.nio.file.NoSuchFileException rather than 404 error.
The exception may be thrown in if (alwaysAsyncFS || useAsyncFS) {
fs.props(file, resultHandler);
}
in getFileProps method in StaticHandlerImpl class.

When I setAlwaysAsyncFS(false) or I don't call setAlwaysAsyncFS(), if it can't find a file ,it return 404 error.That's fine.

@pmlopes pmlopes added the bug label Oct 21, 2015
@pmlopes pmlopes self-assigned this Nov 6, 2015
pmlopes added a commit that referenced this issue Nov 20, 2015
Fixes #231 when using async not found files return 404 not exception
@pmlopes pmlopes removed the to review label Nov 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants