Skip to content

Commit

Permalink
Fix ROOT_URL detection for URLs without trailing slash (#20502)
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang authored Jul 27, 2022
1 parent b899b2d commit 158f274
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web_src/js/features/common-global.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down

0 comments on commit 158f274

Please sign in to comment.