{"record":{"id":"1bbcaf1c01fbe048","repo":"odysseus-dev/odysseus","slug":"url-is-required","errorCode":null,"errorMessage":"URL is required","messagePattern":"URL is required","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"routes/embedding_routes.py","lineNumber":260,"sourceCode":"        return {\"deleted\": True, \"model\": model_name}\n\n    @router.get(\"/endpoint\")\n    def get_endpoint():\n        \"\"\"Get the current custom embedding endpoint config.\"\"\"\n        saved = _load_custom_endpoint()\n        current_url = os.environ.get(\"EMBEDDING_URL\", \"\")\n        return {\n            \"url\": saved.get(\"url\", current_url),\n            \"model\": saved.get(\"model\", os.environ.get(\"EMBEDDING_MODEL\", \"\")),\n            \"active\": bool(saved.get(\"url\") or current_url),\n        }\n\n    @router.post(\"/endpoint\")\n    def set_endpoint(url: str = Form(...), model: str = Form(\"\"), api_key: str = Form(\"\")):\n        \"\"\"Save a custom embedding endpoint URL.\"\"\"\n        url = url.strip()\n        if not url:\n            raise HTTPException(400, \"URL is required\")\n\n        # SSRF hardening: validate the user-supplied URL before any outbound\n        # request. Local-first means loopback/LAN endpoints are allowed by\n        # default; non-HTTP(S) schemes and the cloud metadata range are always\n        # rejected. Set EMBEDDING_BLOCK_PRIVATE_IPS=true for full lockdown.\n        from src.url_safety import check_outbound_url\n        ok, reason = check_outbound_url(\n            url,\n            block_private=os.getenv(\"EMBEDDING_BLOCK_PRIVATE_IPS\", \"false\").lower() == \"true\",\n        )\n        if not ok:\n            raise HTTPException(400, f\"Rejected endpoint URL: {reason}\")\n\n        # Quick health check\n        try:\n            import httpx\n            resp = httpx.post(\n                url,","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/embedding_routes.py#L242-L278","documentation":"Error \"URL is required\" thrown in odysseus-dev/odysseus.","triggerScenarios":"Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.","commonSituations":"See trigger scenarios.","solutions":["Provide the endpoint URL in the request body.","Fill in the Base URL field in the endpoint form before submitting."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}