fix(plugin): don't cache error responses, add SSRF guard to plugin_get

This commit is contained in:
2026-07-13 05:13:01 +08:00
parent 4dfc23d35f
commit ed04b87f16
2 changed files with 7 additions and 1 deletions
+3
View File
@@ -849,6 +849,9 @@ exec mangohud "$@"
import urllib.request
import urllib.error
try:
# SSRF guard: only allow http/https schemes
if not base_url.startswith(("http://", "https://")):
return {"error": "Invalid base_url scheme", "status": 0}
if not path.startswith("/"):
path = "/" + path
url = f"{base_url}/api{path}"