Skip to content

Commit 158f274

Browse files
authored
Fix ROOT_URL detection for URLs without trailing slash (#20502)
1 parent b899b2d commit 158f274

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: web_src/js/features/common-global.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,8 @@ export function initGlobalButtons() {
389389
*/
390390
export function checkAppUrl() {
391391
const curUrl = window.location.href;
392-
if (curUrl.startsWith(appUrl)) {
392+
// some users visit "https://domain/gitea" while appUrl is "https://domain/gitea/", there should be no warning
393+
if (curUrl.startsWith(appUrl) || `${curUrl}/` === appUrl) {
393394
return;
394395
}
395396
if (document.querySelector('.page-content.install')) {

0 commit comments

Comments
 (0)