Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CorsMiddleware ¶
CorsMiddleware handles CORS and OPTIONS preflight requests with optional allowedOrigins. If allowedOrigins is nil or empty, it falls back to getAllowedOrigins(). This middleware intercepts OPTIONS requests only if the Origin header is present and valid, otherwise passing the request to the router (allowing 405/404 responses as appropriate).
Types ¶
type AliasHandler ¶ added in v1.0.4
AliasHandler provides path aliasing by prepending the inference prefix to incoming request paths.
func (*AliasHandler) ServeHTTP ¶ added in v1.0.4
func (h *AliasHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.