]> git.sesse.net Git - remoteglot/blobdiff - www/serve-analysis.js
Add a mechanism for the server to ask the client to upgrade itself.
[remoteglot] / www / serve-analysis.js
index 0faf92f948631f67c27aaa3c010c86c58fc197a1..751a0ffc0b5c6e7c672556855ed8c41219d57e31 100644 (file)
@@ -13,6 +13,7 @@ var delta = require('./js/json_delta.js');
 // Constants.
 var JSON_FILENAME = '/srv/analysis.sesse.net/www/analysis.json';
 var HISTORY_TO_KEEP = 5;
 // Constants.
 var JSON_FILENAME = '/srv/analysis.sesse.net/www/analysis.json';
 var HISTORY_TO_KEEP = 5;
+var MINIMUM_VERSION = null;
 
 // If set to 1, we are already processing a JSON update and should not
 // start a new one. If set to 2, we are _also_ having one in the queue.
 
 // If set to 1, we are already processing a JSON update and should not
 // start a new one. If set to 2, we are _also_ having one in the queue.
@@ -186,6 +187,10 @@ var send_json = function(response, ims, accept_gzip, num_viewers) {
                'Vary': 'Accept-Encoding',
        };
 
                'Vary': 'Accept-Encoding',
        };
 
+       if (MINIMUM_VERSION) {
+               headers['X-RGMV'] = MINIMUM_VERSION;
+       }
+
        if (accept_gzip) {
                headers['Content-Length'] = this_json.gzip.length;
                headers['Content-Encoding'] = 'gzip';
        if (accept_gzip) {
                headers['Content-Length'] = this_json.gzip.length;
                headers['Content-Encoding'] = 'gzip';