tests: web-server: fix an issue with the web server cache

On a decently fast system, some files may be fetched, modified and then
fetched again within the same second. In that case, the web server
replies with a code 304 ("Not modified") to the 2nd query, causing some
tests to fail.

This commit forces the web server to ignore `If-Modified-Since` HTTP
headers, effectively disabling caching in order to mitigate the problem.
This commit is contained in:
Arnaud Ferraris
2021-03-10 18:21:56 +01:00
parent 46b3ede524
commit 6996580bb8

View File

@@ -37,6 +37,7 @@ class RequestHandler(http_server.SimpleHTTPRequestHandler):
def do_GET(self):
if self.handle_tokens():
return None
self.headers.__delitem__("If-Modified-Since")
return super().do_GET()
def run(dir):