fix(api): restrict CORS to allowed origins, refuse cross-origin writes

This commit is contained in:
2026-11-23 13:38:38 +00:00
parent 549d56e0a1
commit f2049383cb
7 changed files with 251 additions and 3 deletions
+4
View File
@@ -12,6 +12,10 @@ server:
read_timeout: "5m"
write_timeout: "5m"
idle_timeout: "2m"
# Origins allowed to call /api from a browser and to open the WebSocket. Exact
# ("https://gohoarder.example.com") or wildcard ("https://*.example.com").
# Empty: same-origin only. A cross-origin DELETE/POST/PATCH is refused with 403.
allowed_origins: []
tls:
enabled: false
cert_file: ""