mirror of
https://github.com/harness/drone.git
synced 2025-05-09 18:12:52 +08:00
fix: [CODE-760]: intenral mapping
This commit is contained in:
parent
4147c691e6
commit
16d44f9ba4
@ -40,9 +40,9 @@ func checkURL(rawURL string, allowLoopback bool, allowPrivateNetwork bool) error
|
||||
// basic validation for loopback / private network addresses (only sanitary to give user an early error)
|
||||
// IMPORTANT: during webook execution loopback / private network addresses are blocked (handles DNS resolution)
|
||||
//
|
||||
//if host == "localhost" {
|
||||
// return check.NewValidationError("localhost is not allowed.")
|
||||
//}
|
||||
if host == "localhost" {
|
||||
return check.NewValidationError("localhost is not allowed.")
|
||||
}
|
||||
|
||||
if ip := net.ParseIP(host); ip != nil {
|
||||
if !allowLoopback && ip.IsLoopback() {
|
||||
|
Loading…
Reference in New Issue
Block a user