We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am getting various exceptions like this:
[2023-02-24 22:41:25 +0100] [512643] [ERROR] Exception in static request handler: path=static, relative_url=fonts/general.woff2 Traceback (most recent call last): File "/home/sebastien/.local/lib/python3.11/site-packages/sanic/mixins/routes.py", line 848, in _static_request_handler response = await validate_file(request.headers, modified_since) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/sebastien/.local/lib/python3.11/site-packages/sanic/response/convenience.py", line 151, in validate_file if last_modified <= if_modified_since: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: can't compare offset-naive and offset-aware datetimes
Which is fixed by ensuring last_modified and if_modified_since are converted to proper timestamps():
if last_modified.timestamp() <= if_modified_since.timestamp():
No response
Sanic CLI
Linux Debian
Sanic 22.12.0; Routing 22.8.0
The text was updated successfully, but these errors were encountered:
Excellent. Can you open a PR with this fix and a unit test?
Sorry, something went wrong.
absolutely
Done with PR #2697 2697
No branches or pull requests
Is there an existing issue for this?
Describe the bug
I am getting various exceptions like this:
Which is fixed by ensuring last_modified and if_modified_since are converted to proper timestamps():
Code snippet
No response
Expected Behavior
No response
How do you run Sanic?
Sanic CLI
Operating System
Linux Debian
Sanic Version
Sanic 22.12.0; Routing 22.8.0
Additional context
No response
The text was updated successfully, but these errors were encountered: