]> git.sesse.net Git - remoteglot/blobdiff - www/serve-analysis.js
Add board/position output to a bitpacked format.
[remoteglot] / www / serve-analysis.js
index edb4a18a9db7b6a933d77771f244806995525304..948ea967c643b5fec2eddd67d02be9606b14f0fe 100644 (file)
@@ -180,17 +180,19 @@ 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',
        };
 
        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);
        }