]> git.sesse.net Git - remoteglot/blobdiff - www/serve-analysis.js
Some pointless HTTP header microoptimization.
[remoteglot] / www / serve-analysis.js
index 171ce82ac6b56d7ead0d6405ec07b41e580a4c64..cfc5f15e40f4395dfc98d910068b0d9ef6c699de 100644 (file)
@@ -183,15 +183,16 @@ var send_json = function(response, ims, accept_gzip, num_viewers) {
                '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',
-               'Expires': 'Mon, 01 Jan 1970 00:00:00 UTC',
                'Vary': 'Accept-Encoding',
        };
 
        if (accept_gzip) {
+               headers['Content-Length'] = this_json.gzip.length;
                headers['Content-Encoding'] = 'gzip';
                response.writeHead(200, headers);
                response.write(this_json.gzip);
        } else {
+               headers['Content-Length'] = this_json.text.length;
                response.writeHead(200, headers);
                response.write(this_json.text);
        }