mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 12:23:22 +00:00
A web page can submit a form or a no-cors fetch to the local dashboard without a CORS preflight, and the handlers accept a text/plain or empty body. Only the MCP, Hooks and Plugins routes checked where a request came from, so any site the user visited could add targets, install, sync, commit, push or upgrade, whenever the browser let the request reach localhost. Every POST, PUT, PATCH and DELETE now needs Fetch Metadata, when sent, to say same-origin, and Origin, when sent, to match the Host. A client that sends neither, such as curl, is unchanged, because a page cannot make a browser omit both on a cross-origin request. The update stream runs updates over GET, as EventSource only opens GET, so it gets the same check. The nginx example now forwards $http_host, which keeps the port, since a proxy that drops it would now fail every change, not only MCP.