From 3a843f2ef50f4e9fcff47f48ae1689cd0a90b186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Tue, 12 Nov 2019 13:18:06 +0100 Subject: [PATCH 1/4] improve "Browser client is out of date" error message --- src/legacy/server/http/version_check.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/legacy/server/http/version_check.js b/src/legacy/server/http/version_check.js index 8bd2bb6e22df1..4bc20d36f8b3c 100644 --- a/src/legacy/server/http/version_check.js +++ b/src/legacy/server/http/version_check.js @@ -27,10 +27,13 @@ export function setupVersionCheck(server, config) { const versionRequested = req.headers[versionHeader]; if (versionRequested && versionRequested !== actualVersion) { - throw badRequest('Browser client is out of date, please refresh the page', { - expected: actualVersion, - got: versionRequested - }); + throw badRequest( + `Browser client is out of date, please refresh the page (Header "${versionHeader}" was ${versionRequested} but should be ${actualVersion})`, + { + expected: actualVersion, + got: versionRequested, + } + ); } return h.continue; From 19a75203dba1cba35d85fb5aa7fc5d504422cae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Tue, 12 Nov 2019 22:37:03 +0100 Subject: [PATCH 2/4] Improve wording of error message Co-Authored-By: Josh Dover --- src/legacy/server/http/version_check.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/legacy/server/http/version_check.js b/src/legacy/server/http/version_check.js index 4bc20d36f8b3c..0942f3b96afef 100644 --- a/src/legacy/server/http/version_check.js +++ b/src/legacy/server/http/version_check.js @@ -28,7 +28,7 @@ export function setupVersionCheck(server, config) { if (versionRequested && versionRequested !== actualVersion) { throw badRequest( - `Browser client is out of date, please refresh the page (Header "${versionHeader}" was ${versionRequested} but should be ${actualVersion})`, + `Browser client is out of date, please refresh the page ("${versionHeader}" header was "${versionRequested}" but should be "${actualVersion}")`, { expected: actualVersion, got: versionRequested, From 016d6993490002de83d457e6c632a68136e3cf9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Sat, 16 Nov 2019 01:26:29 +0100 Subject: [PATCH 3/4] Fox formatting --- src/legacy/server/http/version_check.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/legacy/server/http/version_check.js b/src/legacy/server/http/version_check.js index 0942f3b96afef..b55c922c86bf9 100644 --- a/src/legacy/server/http/version_check.js +++ b/src/legacy/server/http/version_check.js @@ -29,10 +29,7 @@ export function setupVersionCheck(server, config) { if (versionRequested && versionRequested !== actualVersion) { throw badRequest( `Browser client is out of date, please refresh the page ("${versionHeader}" header was "${versionRequested}" but should be "${actualVersion}")`, - { - expected: actualVersion, - got: versionRequested, - } + { expected: actualVersion, got: versionRequested } ); } From d04f6cd9a4704bbdcaa095e7919876fde747c075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Sat, 16 Nov 2019 07:48:52 +0100 Subject: [PATCH 4/4] Fix format --- src/legacy/server/http/version_check.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/legacy/server/http/version_check.js b/src/legacy/server/http/version_check.js index b55c922c86bf9..12666c9a0f3f6 100644 --- a/src/legacy/server/http/version_check.js +++ b/src/legacy/server/http/version_check.js @@ -28,7 +28,8 @@ export function setupVersionCheck(server, config) { if (versionRequested && versionRequested !== actualVersion) { throw badRequest( - `Browser client is out of date, please refresh the page ("${versionHeader}" header was "${versionRequested}" but should be "${actualVersion}")`, + `Browser client is out of date, \ + please refresh the page ("${versionHeader}" header was "${versionRequested}" but should be "${actualVersion}")`, { expected: actualVersion, got: versionRequested } ); }