private function assertValidUrl(string $url): void
    {
        if (!(filter_var($url, FILTER_VALIDATE_URL) || filter_var($url, FILTER_VALIDATE_IP))) {
            throw new RequestContextException("Failed to set invalid URL: $url");
        }
    }