# HG changeset patch # User Nicholas Jillings # Date 1615928560 0 # Node ID bc0ef78bb07acd722291f79e84a582f351c97051 # Parent 21ee5bcf80a3d1cedba9d52256e909e5956f7208 requestKey uses POST to avoid cache diff -r 21ee5bcf80a3 -r bc0ef78bb07a Dockerfile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Dockerfile Tue Mar 16 21:02:40 2021 +0000 @@ -0,0 +1,8 @@ +FROM php:8-apache + +RUN a2enmod rewrite +RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" + +COPY ./apache/000-default.conf /etc/apache2/sites-available/000-default.conf + +EXPOSE 80 diff -r 21ee5bcf80a3 -r bc0ef78bb07a apache/000-default.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/apache/000-default.conf Tue Mar 16 21:02:40 2021 +0000 @@ -0,0 +1,8 @@ + + + ServerAdmin admin@localhost + DocumentRoot /var/www/html + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + diff -r 21ee5bcf80a3 -r bc0ef78bb07a js/core.js --- a/js/core.js Tue Nov 12 16:09:53 2019 +0000 +++ b/js/core.js Tue Mar 16 21:02:40 2021 +0000 @@ -3893,7 +3893,7 @@ function keyPromise() { return new Promise(function (resolve, reject) { var req = new XMLHttpRequest(); - req.open("GET", returnURL + "php/requestKey.php?saveFilenamePrefix=" + parent.filenamePrefix, true); + req.open("POST", returnURL + "php/requestKey.php?saveFilenamePrefix=" + parent.filenamePrefix, true); req.onload = function () { // This is called even on 404 etc // so check the status diff -r 21ee5bcf80a3 -r bc0ef78bb07a python/pythonServer.py --- a/python/pythonServer.py Tue Nov 12 16:09:53 2019 +0000 +++ b/python/pythonServer.py Tue Mar 16 21:02:40 2021 +0000 @@ -83,6 +83,7 @@ s.send_header("Content-type", 'application/javascript') else: s.send_header("Content-type", 'application/octet-stream') + s.send_header("Cache-Control", "no-cache") fileRead = fileDump.read() s.send_header("Content-Length", len(fileRead)) s.end_headers() @@ -117,6 +118,7 @@ fileDump = open(fpath, 'rb') fileBytes = fileDump.read() fileDump.close() + s.send_header("Cache-Control", "no-cache") s.send_header("Content-Length", len(fileBytes)) s.end_headers() s.wfile.write(fileBytes) @@ -137,7 +139,8 @@ if prefix == None: prefix = "save" s.send_response(200) - s.send_header("Content-type", "application/xml"); + s.send_header("Content-Type", "application/xml") + s.send_header("Cache-Control", "no-cache") s.end_headers() reply = "OK"+key+"" if sys.version_info[0] == 2: @@ -288,15 +291,16 @@ def http_do_GET(request): global pseudo_index + print(request.path) if(request.client_address[0] == "127.0.0.1"): if (request.path == "/favicon.ico"): send404(request) elif (request.path.split('?',1)[0] == "/php/requestKey.php"): - requestKey(request); + requestKey(request) elif (request.path.split('?',1)[0] == "/php/pool.php"): - poolXML(request); + poolXML(request) elif (request.path.split('?',1)[0] == "/php/test_write.php"): - testSave(request); + testSave(request) else: request.path = request.path.split('?',1)[0] if (request.path == '/'): @@ -314,6 +318,8 @@ if(request.client_address[0] == "127.0.0.1"): if (request.path.rsplit('?',1)[0] == "/save" or request.path.rsplit('?',1)[0] == "/php/save.php"): saveFile(request) + elif (request.path.split('?',1)[0] == "/php/requestKey.php"): + requestKey(request) else: send404(request)