aboutsummaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-07-27 17:19:10 +0800
committerGitHub <noreply@github.com>2022-07-27 17:19:10 +0800
commit158f2746b8970c46748604e081bdf1fdd8fa9376 (patch)
treec6441bc9651938ba3f73b2fc52c370fd76be4940 /web_src
parentb899b2df5a8b419436f8e21f0498803425bf911d (diff)
downloadgitea-158f2746b8970c46748604e081bdf1fdd8fa9376.tar.gz
gitea-158f2746b8970c46748604e081bdf1fdd8fa9376.zip
Fix ROOT_URL detection for URLs without trailing slash (#20502)
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/features/common-global.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/web_src/js/features/common-global.js b/web_src/js/features/common-global.js
index 419c5996dc..3ce74442a0 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')) {