{"record":{"id":"1aad851908b9476c","repo":"affaan-m/ECC","slug":"unsupported-remote-content-type-content-type","errorCode":null,"errorMessage":"unsupported remote content type: {content_type}","messagePattern":"unsupported remote content type: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/continuous-learning-v2/scripts/instinct-cli.py","lineNumber":231,"sourceCode":"            or ip.is_reserved\n            or ip.is_unspecified\n        ):\n            raise ValueError(f\"remote import host resolves to a non-public address: {host}\")\n\n    return urllib.parse.urlunparse(parsed)\n\n\ndef _fetch_import_url(source: str, *, max_bytes: int = 2 * 1024 * 1024) -> str:\n    \"\"\"Fetch a validated remote instinct file with bounded size and timeout.\"\"\"\n    url = _validate_import_url(source)\n    req = urllib.request.Request(url, headers={\"User-Agent\": \"ECC-instinct-import/2\"})\n    with urllib.request.urlopen(req, timeout=15) as response:\n        content_type = response.headers.get(\"Content-Type\", \"\")\n        if content_type and not any(\n            allowed in content_type.lower()\n            for allowed in (\"text/\", \"markdown\", \"yaml\", \"json\", \"octet-stream\")\n        ):\n            raise ValueError(f\"unsupported remote content type: {content_type}\")\n        data = response.read(max_bytes + 1)\n    if len(data) > max_bytes:\n        raise ValueError(f\"remote import exceeds {max_bytes} bytes\")\n    return data.decode(\"utf-8\")\n\n\ndef _yaml_quote(value: str) -> str:\n    \"\"\"Quote a string for safe YAML frontmatter serialization.\n\n    Uses double quotes and escapes embedded double-quote characters to\n    prevent malformed YAML when the value contains quotes.\n    \"\"\"\n    escaped = value.replace('\\\\', '\\\\\\\\').replace('\"', '\\\\\"')\n    return f'\"{escaped}\"'\n\n\n# ─────────────────────────────────────────────\n# Project Detection (Python equivalent of detect-project.sh)","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/skills/continuous-learning-v2/scripts/instinct-cli.py#L213-L249","documentation":"Error \"unsupported remote content type: {content_type}\" thrown in affaan-m/ECC.","triggerScenarios":"Thrown at skills/continuous-learning-v2/scripts/instinct-cli.py:231 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Serve the instinct file with an allowed Content-Type: text/*, markdown, yaml, json, or application/octet-stream.","If the server returns HTML (e.g. an error or login page), download the raw file URL instead of a viewer page."],"exampleFix":"# use the raw URL: https://raw.example.com/instinct.md (text/markdown), not an HTML preview page","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}