-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Access log logs wrong status on file responses #347
Comments
This is confirmed, and it happens on ASGI |
Are you going to EuroPython by any chance? :D |
Nope, unfortunately this year I won't be able to attend :( |
Hardcode response to 200 if the file exists? 😆 Though would not handle not changed responses... |
So, I pushed 72a9a21 that won't fix the actual issue, but at least prevents fake 500 status codes in access logs. I'll keep this opened until I find a proper fix. |
I noticed that 200s are logged as 500. Modified https://github.com/emmett-framework/granian/blob/master/granian/asgi.py#L109 with:
Output:
As you can see, the access log is logged before the response is sent, and I assume 500 is the default value.
The response type in question is a
FileResponse
fromstarlette
. When I remove my for loop, the status code logged is always 500.The text was updated successfully, but these errors were encountered: