Skip to content

Getting http status code 502 instead of 404 for missing images #33

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

Closed
Chinna-SHS opened this issue Jul 5, 2018 · 4 comments
Closed

Comments

@Chinna-SHS
Copy link

hi
I am trying to access the file via cloudfront and that file does not exists in S3 bucket. I am getting 502 error code instead of 404 in my browser.

Is it the right expected response code from this service ?

Also if my original image not found, I want to return noImageFound.jpeg as a response. Is there anyway to do it ?

@zatarra
Copy link

zatarra commented Jul 5, 2018

I think that the issue is related to a misspelled variable: https://github.com/awslabs/serverless-image-handler/blob/6a30bd785999bea6ba9dfb402bf550b2dd8f2f8f/source/image-handler/lambda_function.py#L216

replacing:
return response_formater(status_code=response.status_code)
with
return response_formater(status_code=thumbor_response.status_code)

Should fix the 502 error.

@thomasphorton
Copy link

Thank you for bringing this to our attention! We've got a fix in the pipeline for our next release.

@gsingh04
Copy link
Member

please see #41 which will fix this.

@shsenior shsenior closed this as completed Nov 8, 2018
@gsingh04
Copy link
Member

gsingh04 commented Nov 8, 2018

release v3.1.0 has been pushed, closing the issue.

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 a pull request may close this issue.

5 participants