From 2a5f7294fa7dfcb09eafb889152791ceeb1d641e Mon Sep 17 00:00:00 2001 From: Andy Wick Date: Sun, 17 Sep 2023 15:47:19 -0400 Subject: [PATCH] handle cookies encoded, bad proxy --- CHANGELOG | 2 ++ common/auth.js | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 848373ad7c..d21a6c1c8b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -29,6 +29,8 @@ NOTICE: Restart wiseService before capture when upgrading NOTICE: Cross-cluster Shortcuts require you to not restart all your viewers at once after upgrading 4.5.1 2023/09/xx + - release - fix viewer systemd file + - all - handle cookies encoded, bad proxy 4.5.0 2023/09/13 - release - node 16.20.2 diff --git a/common/auth.js b/common/auth.js index 1c183a4f51..90c4c0fcfc 100644 --- a/common/auth.js +++ b/common/auth.js @@ -752,9 +752,15 @@ class Auth { // ---------------------------------------------------------------------------- // Decrypt the auth string into an object - // IV.E.H static auth2obj (auth, secret) { + // New json style if (auth[0] === '{') { return Auth.auth2objNext(auth, secret); } + + // New json style, but still encoded, bad proxy probably + if (auth.startsWith('%7B%22')) { return Auth.auth2objNext(decodeURIComponent(auth), secret); } + + // Old style, IV.E.H + const parts = auth.split('.'); if (parts.length !== 3) {