Skip to content

Commit

Permalink
fix: set cdn to basePath if cdn is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Sep 22, 2022
1 parent 4d6ab53 commit 0039dc1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/static/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/alist-org/alist/v3/cmd/flags"
"github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/internal/setting"
"github.com/alist-org/alist/v3/pkg/utils"
"github.com/alist-org/alist/v3/public"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
Expand All @@ -28,6 +29,12 @@ func UpdateIndex() {
cdn := strings.TrimSuffix(conf.Conf.Cdn, "/")
cdn = strings.ReplaceAll(cdn, "$version", conf.WebVersion)
basePath := setting.GetStr(conf.BasePath)
if basePath != "" {
basePath = utils.StandardizePath(basePath)
}
if cdn == "" {
cdn = basePath
}
apiUrl := setting.GetStr(conf.ApiUrl)
favicon := setting.GetStr(conf.Favicon)
title := setting.GetStr(conf.SiteTitle)
Expand Down

0 comments on commit 0039dc1

Please sign in to comment.