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,
};
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',
};
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();
}