From 39b2ede93023721e54854778585df632fe0071e5 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 27 Jul 2022 23:49:01 +0800 Subject: [PATCH] Fix ROOT_URL detection for URLs without trailing slash (#20503) --- web_src/js/features/common-global.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web_src/js/features/common-global.js b/web_src/js/features/common-global.js index 419c5996dc6..3ce74442a0c 100644 --- a/web_src/js/features/common-global.js +++ b/web_src/js/features/common-global.js @@ -389,7 +389,8 @@ export function initGlobalButtons() { */ export function checkAppUrl() { const curUrl = window.location.href; - if (curUrl.startsWith(appUrl)) { + // some users visit "https://domain/gitea" while appUrl is "https://domain/gitea/", there should be no warning + if (curUrl.startsWith(appUrl) || `${curUrl}/` === appUrl) { return; } if (document.querySelector('.page-content.install')) {