mirror of
https://github.com/projectdiscovery/httpx
synced 2026-06-08 16:50:17 +00:00
179678581d
* Exclude WAF
* Add missing 's'
* Revert "Add missing 's'"
This reverts commit 467ceca320.
22 lines
585 B
Go
22 lines
585 B
Go
package httpx
|
|
|
|
import (
|
|
"fmt"
|
|
"net"
|
|
)
|
|
|
|
// CdnCheck verifies if the given ip is part of Cdn/WAF ranges
|
|
func (h *HTTPX) CdnCheck(ip string) (bool, string, error) {
|
|
if h.cdn == nil {
|
|
return false, "", fmt.Errorf("cdn client not configured")
|
|
}
|
|
|
|
// the goal is to check if ip is part of cdn/waf to decide if target should be scanned or not
|
|
// since 'cloud' itemtype does not fit logic here , we consider target is not part of cdn/waf
|
|
matched, value, itemType, err := h.cdn.Check(net.ParseIP((ip)))
|
|
if itemType == "cloud" {
|
|
return false, "", err
|
|
}
|
|
return matched, value, err
|
|
}
|