Merge 781585d9bd into d087e46bd1
This commit is contained in:
commit
ec79e48646
|
|
@ -1449,6 +1449,11 @@ func allowedHostsMiddleware(addr net.Addr) gin.HandlerFunc {
|
|||
|
||||
if addr, err := netip.ParseAddr(host); err == nil {
|
||||
if addr.IsLoopback() || addr.IsPrivate() || addr.IsUnspecified() || isLocalIP(addr) {
|
||||
if c.Request.Method == http.MethodOptions {
|
||||
c.AbortWithStatus(http.StatusNoContent)
|
||||
return
|
||||
}
|
||||
|
||||
c.Next()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue