mirror of
https://github.com/projectdiscovery/httpx
synced 2026-06-08 16:50:17 +00:00
3b5554af36
* 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>
22 lines
620 B
Go
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
|
|
}
|