X-Git-Url: https://git.sesse.net/?p=remoteglot;a=blobdiff_plain;f=www%2Fserve-analysis.js;h=0faf92f948631f67c27aaa3c010c86c58fc197a1;hp=cfc5f15e40f4395dfc98d910068b0d9ef6c699de;hb=00caa4a350a597e9023675343374ace0836bdd92;hpb=778e663fc0fd4657d78c8a6d27ea14e120cfb025 diff --git a/www/serve-analysis.js b/www/serve-analysis.js index cfc5f15..0faf92f 100644 --- a/www/serve-analysis.js +++ b/www/serve-analysis.js @@ -93,8 +93,8 @@ var create_json_historic_diff = function(new_json, history_left, new_diff_json, zlib.gzip(diff_text, function(err, buffer) { if (err) throw err; new_diff_json[histobj.last_modified] = { - plain: diff, - text: diff_text, + parsed: diff, + plain: diff_text, gzip: buffer, last_modified: new_json.last_modified, }; @@ -180,9 +180,9 @@ var send_json = function(response, ims, accept_gzip, num_viewers) { var headers = { 'Content-Type': 'text/json', - 'X-Remoteglot-Last-Modified': this_json.last_modified, - 'X-Remoteglot-Num-Viewers': num_viewers, - 'Access-Control-Expose-Headers': 'X-Remoteglot-Last-Modified, X-Remoteglot-Num-Viewers', + 'X-RGLM': this_json.last_modified, + 'X-RGNV': num_viewers, + 'Access-Control-Expose-Headers': 'X-RGLM, X-RGNV', 'Vary': 'Accept-Encoding', }; @@ -192,9 +192,9 @@ var send_json = function(response, ims, accept_gzip, num_viewers) { response.writeHead(200, headers); response.write(this_json.gzip); } else { - headers['Content-Length'] = this_json.text.length; + headers['Content-Length'] = this_json.plain.length; response.writeHead(200, headers); - response.write(this_json.text); + response.write(this_json.plain); } response.end(); }