mirror of
https://github.com/ollama/ollama
synced 2026-04-23 08:45:14 +00:00
Merge 781585d9bd into 160660e572
This commit is contained in:
commit
6918e157ba
|
|
@ -1624,6 +1624,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 a new issue