Help us shape the future of Go! Take the 2026 Go Developer Survey

corshttp

package
v1.152.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

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). Its own package so internal/httpserver, at its size budget, holds the assembly alone.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gated added in v1.152.6

func Gated(admit SiteCheck) func(http.Handler) http.Handler

Gated is Middleware with the public map paths served only to the sites admit allows.

func Middleware

func Middleware(next http.Handler) http.Handler

Middleware 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.

func WithoutHooks

func WithoutHooks(receiver, rest http.Handler) http.Handler

WithoutHooks routes the routes that answer their own cross-origin requests (ownCORSPrefixes) around cors.

Types

type SiteCheck added in v1.152.6

type SiteCheck func(*http.Request) bool

SiteCheck reports whether a read of a public map path is served for the site that made it (#2393). nil serves every site.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL