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

Return 404 for non-existent file #183

Merged
merged 4 commits into from
Mar 18, 2024
Merged

Conversation

jerico
Copy link
Contributor

@jerico jerico commented Mar 13, 2024

Tachyon currently returns an empty body with 200 response code when an exception is raised when fetching a file from S3.

This PR adds error handling specifically for AccessDenied exceptions. When this exception occurs, the Lambda invocation’s response code will be set to 404, aligning with how Tachyon v2 handles similar exceptions.

Fixes #176

Catches exception when fetching a file from S3. If it's `AccessDenied`, response code from the lambda invokation will be 404.
src/lambda-handler.ts Outdated Show resolved Hide resolved
src/lambda-handler.ts Outdated Show resolved Hide resolved
tests/test-lambda.ts Show resolved Hide resolved
@jerico jerico requested a review from kovshenin March 14, 2024 11:48
@jerico jerico merged commit de6067b into master Mar 18, 2024
4 checks passed
@jerico jerico deleted the return-404-non-existent-file branch March 18, 2024 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-existent image returns 200 with empty body
2 participants