mirror of
https://github.com/alireza0/x-ui.git
synced 2026-10-20 18:51:33 +00:00
[sub] url support for reverse proxy #607
This commit is contained in:
parent
b41aef37e5
commit
a8878bc1dc
12 changed files with 89 additions and 50 deletions
|
|
@ -44,6 +44,7 @@ type AllSetting struct {
|
|||
SubUpdates int `json:"subUpdates" form:"subUpdates"`
|
||||
SubEncrypt bool `json:"subEncrypt" form:"subEncrypt"`
|
||||
SubShowInfo bool `json:"subShowInfo" form:"subShowInfo"`
|
||||
SubURI string `json:"subURI" form:"subURI"`
|
||||
}
|
||||
|
||||
func (s *AllSetting) CheckValid() error {
|
||||
|
|
@ -94,6 +95,13 @@ func (s *AllSetting) CheckValid() error {
|
|||
s.WebBasePath += "/"
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(s.SubPath, "/") {
|
||||
s.SubPath = "/" + s.SubPath
|
||||
}
|
||||
if !strings.HasSuffix(s.SubPath, "/") {
|
||||
s.SubPath += "/"
|
||||
}
|
||||
|
||||
_, err := time.LoadLocation(s.TimeLocation)
|
||||
if err != nil {
|
||||
return common.NewError("time location not exist:", s.TimeLocation)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue