package httpapi import ( "net/http" "net/url" "strings" ) // Browser-driven cross-site attacks are the realistic threat here. The // dashboard is reached with a browser session, so any page the operator // happens to visit can make their browser issue requests to the pool // with whatever credentials that session carries. Two shapes matter: // // - Cross-Site WebSocket Hijacking. The WebSocket handshake is not // subject to the same-origin policy, so without a check any site // could open /api/ws and read the whole snapshot: payout addresses, // per-worker hashrates, block history. // - CSRF against the state-changing POSTs. The admin endpoints take no // body, so a plain