mirror of
https://github.com/Li4n0/revsuit.git
synced 2026-09-26 16:41:53 +08:00
fix(http): fix the problem that ip_header setting does not take effect (#23)
This commit is contained in:
@@ -24,7 +24,7 @@ type Config struct {
|
|||||||
Database string
|
Database string
|
||||||
LogLevel string `yaml:"log_level"`
|
LogLevel string `yaml:"log_level"`
|
||||||
Notice noticeConfig
|
Notice noticeConfig
|
||||||
rhttp.Config
|
HTTP rhttp.Config
|
||||||
DNS dns.Config
|
DNS dns.Config
|
||||||
MySQL mysql.Config
|
MySQL mysql.Config
|
||||||
RMI rmi.Config
|
RMI rmi.Config
|
||||||
|
|||||||
@@ -204,8 +204,8 @@ func New(c *Config) *Revsuit {
|
|||||||
if c.Token != "" {
|
if c.Token != "" {
|
||||||
s.http.SetToken(c.Token)
|
s.http.SetToken(c.Token)
|
||||||
}
|
}
|
||||||
if c.IpHeader != "" {
|
if c.HTTP.IpHeader != "" {
|
||||||
s.http.SetIpHeader(c.IpHeader)
|
s.http.SetIpHeader(c.HTTP.IpHeader)
|
||||||
}
|
}
|
||||||
if c.Domain != "" {
|
if c.Domain != "" {
|
||||||
s.dns.SetServerDomain(c.Domain)
|
s.dns.SetServerDomain(c.Domain)
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ func (revsuit *Revsuit) getPlatformConfig(c *gin.Context) {
|
|||||||
res["ExternalIP"] = revsuit.config.ExternalIP
|
res["ExternalIP"] = revsuit.config.ExternalIP
|
||||||
res["Database"] = revsuit.config.Database
|
res["Database"] = revsuit.config.Database
|
||||||
res["LogLevel"] = revsuit.config.LogLevel
|
res["LogLevel"] = revsuit.config.LogLevel
|
||||||
res["IpHeader"] = revsuit.config.IpHeader
|
res["IpHeader"] = revsuit.config.HTTP.IpHeader
|
||||||
|
|
||||||
c.JSON(200, res)
|
c.JSON(200, res)
|
||||||
}
|
}
|
||||||
@@ -194,8 +194,8 @@ func (revsuit *Revsuit) updatePlatformConfig(c *gin.Context) {
|
|||||||
log.Info("Update platform config [database] to %s", form["Database"])
|
log.Info("Update platform config [database] to %s", form["Database"])
|
||||||
}
|
}
|
||||||
|
|
||||||
if form["IpHeader"] != revsuit.config.IpHeader {
|
if form["IpHeader"] != revsuit.config.HTTP.IpHeader {
|
||||||
revsuit.config.IpHeader = form["IpHeader"]
|
revsuit.config.HTTP.IpHeader = form["IpHeader"]
|
||||||
revsuit.http.SetIpHeader(form["IpHeader"])
|
revsuit.http.SetIpHeader(form["IpHeader"])
|
||||||
log.Info("Update http config [ip_header] to %s", form["IpHeader"])
|
log.Info("Update http config [ip_header] to %s", form["IpHeader"])
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user