Fix frontend not updating publicConfig.json

This changes the handshake sequence to use “bootTime” (a unique key
based off the time) to make sure the frontend configuration matches the
current one. If not, the client pulls the update and validates before
requesting the listing.
This commit is contained in:
Cryptkeeper
2016-02-06 18:26:29 -06:00
parent 143e99876a
commit 798dda8f12
5 changed files with 86 additions and 44 deletions

View File

@ -4,6 +4,7 @@ var url = require('url');
var mime = require('mime');
var io = require('socket.io');
var util = require('./util');
var logger = require('./logger');
var config = require('../config.json');
@ -65,7 +66,8 @@ function handleRequest(req, res) {
var publicConfig = {
categories: categories,
graphDuration: config.graphDuration,
servers: servers
servers: servers,
bootTime: util.getBootTime()
};
res.write('setPublicConfig(' + JSON.stringify(publicConfig) + ');');