From 1ee2f70f49965d1eff744a1c19428f2106b9cc29 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 12 Apr 2021 17:49:22 +0530 Subject: [PATCH] fix spreadsheet CSP checkup and confirm that /api/broadcast is accessible --- www/checkup/main.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/www/checkup/main.js b/www/checkup/main.js index 42864b4f3..7afa06abf 100644 --- a/www/checkup/main.js +++ b/www/checkup/main.js @@ -210,7 +210,7 @@ define([ }; $.ajax(url, { - success: function (data, textStatus, xhr) { + complete: function (xhr) { cb(!Object.keys(expect).some(function (k) { var response = xhr.getResponseHeader(k); console.log(k, response); @@ -220,6 +220,17 @@ define([ }); }, _alert("Missing HTTP headers required for XLSX export")); + assert(function (cb) { + cb(true); + $.ajax('/api/broadcast', { + dataType: 'text', + complete: function (xhr) { + console.log(xhr); + cb(xhr.status === 200); + }, + }); + }, _alert("/api/broadcast is not available")); + var row = function (cells) { return h('tr', cells.map(function (cell) { return h('td', cell);