1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-24 13:09:23 -05:00

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

This commit is contained in:
wxiaoguang 2022-07-27 23:49:01 +08:00 committed by GitHub
parent 0a32bd56eb
commit 39b2ede930
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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')) {