Make StaticRoute support Last-Modified and If-Modified-Since headers#386
Make StaticRoute support Last-Modified and If-Modified-Since headers#386asvetlov merged 4 commits intoaio-libs:masterfrom magv:master
Conversation
There was a problem hiding this comment.
Please split the test into several (five?) ones.
|
The PR is good but I guess to add |
|
See also #165 |
|
I've split the tests somewhat (some of them are superfluous though). Would you like the |
|
Yes, properties make sense only if they have By standard it is timestamp. If you need arbitrary data like hash please use ETAG header. |
|
Something like this then? I think it's overengineering, to be honest. |
aiohttp/web_reqrep.py
Outdated
There was a problem hiding this comment.
Move it into Request object: it's request-only header
|
I want to make properties for all common HTTP headers eventually. |
Make StaticRoute support Last-Modified and If-Modified-Since headers
|
Thanks! |
This change makes
StaticRouteaddLast-Modifiedheaders to the responses and recognizeIf-Modified-Sinceheaders in the requests. IfIf-Modified-Sinceheader is present and is equal to the modification time of the file being served,StaticRoutewill now respond with a 304 "Not Modified" response.This is a small feature, but rather useful if you hit "Refresh" button often.