Explicit usage of CIMultiDict getters (#2104)

This commit is contained in:
ENT8R
2021-04-08 12:30:12 +02:00
committed by GitHub
parent 1a352ddf55
commit ad97cac313
8 changed files with 27 additions and 18 deletions

View File

@@ -665,7 +665,10 @@ class RouteMixin:
modified_since = strftime(
"%a, %d %b %Y %H:%M:%S GMT", gmtime(stats.st_mtime)
)
if request.headers.get("If-Modified-Since") == modified_since:
if (
request.headers.getone("if-modified-since", None)
== modified_since
):
return HTTPResponse(status=304)
headers["Last-Modified"] = modified_since
_range = None