Add never option to PUBLIC_URL_DETECTION configuration (#36785)
Follow up #34250 Docs: https://gitea.com/gitea/docs/pulls/353 --------- Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -44,6 +44,7 @@ const (
|
||||
const (
|
||||
PublicURLAuto = "auto"
|
||||
PublicURLLegacy = "legacy"
|
||||
PublicURLNever = "never"
|
||||
)
|
||||
|
||||
// Server settings
|
||||
@@ -286,7 +287,7 @@ func loadServerFrom(rootCfg ConfigProvider) {
|
||||
defaultAppURL := string(Protocol) + "://" + Domain + ":" + HTTPPort
|
||||
AppURL = sec.Key("ROOT_URL").MustString(defaultAppURL)
|
||||
PublicURLDetection = sec.Key("PUBLIC_URL_DETECTION").MustString(PublicURLLegacy)
|
||||
if PublicURLDetection != PublicURLAuto && PublicURLDetection != PublicURLLegacy {
|
||||
if PublicURLDetection != PublicURLAuto && PublicURLDetection != PublicURLLegacy && PublicURLDetection != PublicURLNever {
|
||||
log.Fatal("Invalid PUBLIC_URL_DETECTION value: %s", PublicURLDetection)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user