Files
Ice3man 3b5554af36 feat: added enhancements to favicon + made API public (#1774)
* more additions and enhancements to httpx

* feat: added enhancements to favicon + made API public

* update deps

* misc additions

* fix hasChain with 1 status code not working

* Revert "fix hasChain with 1 status code not working"

This reverts commit fabadcddbc.

---------

Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
2024-06-24 19:07:26 +05:30

22 lines
620 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, 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, value, itemType, err
}
return matched, value, itemType, err
}