Documentation
¶
Overview ¶
Package middleware provides HTTP middleware functions for Packhorse.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Allowlist ¶
Allowlist wraps allowlist.Allowlist in a HTTP middleware. Requests for repositories not on the list are sent to fallback, which proxies them straight to the upstream without consulting the cache.
When list is nil or its disabled flag is set, every request flows through to next — see allowlist.Allowlist.Allowed.
func ProtocolV2 ¶
ProtocolV2 is HTTP middleware that enforces Git Protocol v2. It checks for the Git-Protocol header with value "version=2". Returns 400 Bad Request if missing or has different value.
This middleware should be applied to Git protocol routes but not to API routes that don't require Git protocol headers.
Types ¶
This section is empty.