{"modulePath":"github.com/txn2/mcp-data-platform","version":"v1.171.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package corshttp\n\nPackage corshttp is the CORS layer of the platform's listener: the headers a browser-based MCP client needs, the preflight answer, and the one path family that bypasses it, the webhook receiver (#1870). Its own package so internal/httpserver, at its size budget, holds the assembly alone.\n\n## Functions\n\n```go\nfunc Gated(admit SiteCheck, own ...string) func(http.Handler) http.Handler\n```\nGated is Middleware with the public map paths served only to the sites admit allows. own are the platform's own origins beside the one a request arrives on (the portal's public base URL); only those are answered with credentials.\n\n```go\nfunc Middleware(next http.Handler) http.Handler\n```\nMiddleware adds CORS headers for browser-based MCP clients, and serves the public map paths to every site. It is the layer the in-process readers (the tile worker, the PDF export, a script's self-call) go through; the listener uses Gated.\n\n```go\nfunc WithoutHooks(receiver, rest http.Handler) http.Handler\n```\nWithoutHooks routes the routes that answer their own cross-origin requests (ownCORSPrefixes) around cors.\n\n## Types\n\n```go\ntype SiteCheck func(*http.Request) bool\n```\nSiteCheck reports whether a read of a public map path is served for the site that made it (#2393). nil serves every site.\n\n","path":"github.com/txn2/mcp-data-platform/internal/httpserver/corshttp","name":"corshttp","synopsis":"Package corshttp is the CORS layer of the platform's listener: the headers a browser-based MCP client needs, the preflight answer, and the one path family that bypasses it, the webhook receiver (#1870).","isRedistributable":true}
