mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-02-03 15:23:30 +08:00
fix: 修复baseurl端口问题
This commit is contained in:
@@ -83,7 +83,11 @@ func (c *Config) GetBaseURL(req *http.Request) string {
|
||||
if proto := req.Header.Get("X-Forwarded-Proto"); proto != "" {
|
||||
scheme = proto
|
||||
}
|
||||
return fmt.Sprintf("%s://%s:%s", scheme, req.Host, c.Server.Port)
|
||||
baseurl := fmt.Sprintf("%s://%s", scheme, req.Host)
|
||||
if c.Server.Port != "" {
|
||||
baseurl = fmt.Sprintf("%s:%s", baseurl, c.Server.Port)
|
||||
}
|
||||
return baseurl
|
||||
}
|
||||
|
||||
func Init() (*Config, error) {
|
||||
|
||||
Reference in New Issue
Block a user