{"record":{"id":"3921fa9f409365d7","repo":"ZhuLinsen/daily_stock_analysis","slug":"source-url-must-be-an-absolute-http-s-url","errorCode":null,"errorMessage":"source url must be an absolute http(s) URL","messagePattern":"source url must be an absolute http\\(s\\) URL","errorType":"validation","errorClass":"IntelligenceServiceError","httpStatus":400,"severity":"error","filePath":"src/services/intelligence_service.py","lineNumber":397,"sourceCode":"        if market not in _ALLOWED_MARKETS:\n            raise IntelligenceServiceError(f\"unsupported market: {market}\")\n        return {\n            \"name\": name[:100],\n            \"source_type\": source_type,\n            \"url\": url,\n            \"enabled\": enabled,\n            \"scope_type\": scope_type,\n            \"scope_value\": scope_value[:64] if scope_value else None,\n            \"market\": market,\n            \"description\": description,\n        }\n\n    def _validate_url(self, raw_url: str, *, allow_no_url: bool = False) -> None:\n        if allow_no_url and raw_url.startswith(\"no-url:intel:\"):\n            return\n        parsed = urlparse(raw_url)\n        if parsed.scheme.lower() not in {\"http\", \"https\"} or not parsed.netloc:\n            raise IntelligenceServiceError(\"source url must be an absolute http(s) URL\")\n        if parsed.username or parsed.password:\n            raise IntelligenceServiceError(\"source url must not contain credentials\")\n        hostname = (parsed.hostname or \"\").strip().lower().rstrip(\".\")\n        if not hostname:\n            raise IntelligenceServiceError(\"source url host is required\")\n        if hostname in _PRIVATE_HOSTNAMES or hostname.endswith(\".local\"):\n            raise IntelligenceServiceError(\"source url host is not allowed\")\n        has_public_address = False\n        try:\n            ip = ipaddress.ip_address(hostname)\n        except ValueError:\n            ip = None\n        if ip is not None:\n            if self._is_blocked_ip(ip):\n                raise IntelligenceServiceError(\"source url must not target private or local network addresses\")\n            return\n        try:\n            addr_infos = socket.getaddrinfo(hostname, None)","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/ZhuLinsen/daily_stock_analysis/blob/5159bd72e8373d215492dff122acc9d389e219c9/src/services/intelligence_service.py#L379-L415","documentation":"Error \"source url must be an absolute http(s) URL\" thrown in ZhuLinsen/daily_stock_analysis.","triggerScenarios":"Thrown at src/services/intelligence_service.py:397 when the library encounters an invalid state.","commonSituations":"Raised when an intelligence source URL is not an absolute http(s) URL; occurs with relative URLs, ftp:// or scheme-less input.","solutions":["Provide a full absolute URL starting with http:// or https://.","Remove relative paths or protocol-relative URLs from the source configuration.","Prefer https URLs for feed sources."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5159bd72e8373d215492dff122acc9d389e219c9","analyzedAt":"2026-08-15T01:59:36.292Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}