fix: force_https
not take effect on noRoute
(close #5167)
This commit is contained in:
parent
3231c3d930
commit
6f6d20e1ba
@ -22,7 +22,7 @@ func Init(e *gin.Engine) {
|
|||||||
Cors(e)
|
Cors(e)
|
||||||
g := e.Group(conf.URL.Path)
|
g := e.Group(conf.URL.Path)
|
||||||
if conf.Conf.Scheme.HttpPort != -1 && conf.Conf.Scheme.HttpsPort != -1 && conf.Conf.Scheme.ForceHttps {
|
if conf.Conf.Scheme.HttpPort != -1 && conf.Conf.Scheme.HttpsPort != -1 && conf.Conf.Scheme.ForceHttps {
|
||||||
g.Use(middlewares.ForceHttps)
|
e.Use(middlewares.ForceHttps)
|
||||||
}
|
}
|
||||||
g.Any("/ping", func(c *gin.Context) {
|
g.Any("/ping", func(c *gin.Context) {
|
||||||
c.String(200, "pong")
|
c.String(200, "pong")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user