From: Jan Dohl Date: Sat, 3 Feb 2018 22:58:19 +0000 (+0100) Subject: Fix erroneous 304 of StaticFileHandler X-Git-Tag: v5.0.0~7^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcd0b0b544f59d5a4bd9a5132d7a124cca78d4a0;p=thirdparty%2Ftornado.git Fix erroneous 304 of StaticFileHandler StaticFileHandler would return a 304 despite the client sending a non-matching Etag header when If-Modified-Since matches --- diff --git a/tornado/web.py b/tornado/web.py index 5fa3abd8b..7bf5415d0 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -2499,8 +2499,9 @@ class StaticFileHandler(RequestHandler): .. versionadded:: 3.1 """ - if self.check_etag_header(): - return True + # If client sent If-None-Match, use it, ignore If-Modified-Since + if self.request.headers.get('If-None-Match'): + return self.check_etag_header() # Check the If-Modified-Since, and don't send the result if the # content has not been modified