Fix ROOT_URL detection for URLs without trailing slash (#20502)

tokarchuk/v1.18
wxiaoguang 2 years ago committed by GitHub
parent b899b2df5a
commit 158f2746b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      web_src/js/features/common-global.js

@ -389,7 +389,8 @@ export function initGlobalButtons() {
*/ */
export function checkAppUrl() { export function checkAppUrl() {
const curUrl = window.location.href; 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; return;
} }
if (document.querySelector('.page-content.install')) { if (document.querySelector('.page-content.install')) {

Loading…
Cancel
Save