httpx

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package httpx holds small protocol-level HTTP middlewares shared across the mounted APIs. It deliberately knows nothing about Astrate domains.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORS

func CORS(allowedOrigins []string) func(http.Handler) http.Handler

CORS returns a middleware that answers preflight requests and stamps Access-Control headers for the allowed origins ("*" allows any). Preflights are answered before any downstream auth runs — browsers send them without an Authorization header. Requests from origins not in the list pass through unstamped: the browser, not the server, enforces the block.

func NotFound

func NotFound(mux *http.ServeMux) http.Handler

NotFound returns a handler that serves mux, replacing Go's plain-text "404 page not found" with the JSON error envelope upstream Astarte emits for an unmatched route under a known service prefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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