-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
ValueError: year is out of range #5925
Comments
Looks like it just passes directly to Documentation, however, say we should be returning |
Looks like it could just be a aiohttp/aiohttp/web_request.py Line 487 in 33a38b8
Should be an easy fix, but will need to add a test to reproduce the error first. I'm short on time, but feel free to open a PR. |
Thanks @Dreamsorcerer for the guidance! I opened a PR based on your suggestion. |
Describe the bug
A bot is scanning one of my websites, and for some reason it is using this as header:
If-Modified-Since: Tue, 08 Oct 4446413 00:56:40 GMT
Not sure what the bot is smoking, but for sure that year is a bit odd. Now when I try
request.if_modified_since
aiohttp
bails out withValueError: year 4447131 is out of range
.I am not completely sure if this is a bug you want to address in this library, or if I should just capture the
ValueError
and ignore theif_modified_since
header with these kind of weird values, but I at least wanted to let you know about this issue.To Reproduce
Given this server:
Launch this curl against it:
curl -H "If-Modified-Since: Tue, 08 Oct 4446413 00:56:40 GMT" http://127.0.0.1:8080
Expected behavior
Graceful error, possibly even
None
, if theIf-Modified-Since
header cannot be parsed correctly.Logs/tracebacks
Python Version
aiohttp Version
multidict Version
yarl Version
OS
Linux
Related component
Server
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: