httpheader

package
v2.15.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseBearerToken added in v2.10.0

func ParseBearerToken(raw string) (string, bool)

ParseBearerToken extracts the credentials from an Authorization header value carrying the Bearer scheme, reporting false when the header is absent, uses a different scheme, or carries an empty token.

The scheme is matched case-insensitively and surrounding whitespace is ignored, because RFC 7235 defines the auth-scheme token as case-insensitive and permits leading whitespace before it. The gRPC worker API already parsed it that way while the Pull and Admin HTTP APIs required exactly "Bearer ", so the same client credential was accepted on one transport and rejected on the other. This is the single implementation for all three.

The token itself is returned verbatim apart from surrounding whitespace; callers compare it in constant time.

func ValidateMap

func ValidateMap(headers map[string]string) error

ValidateMap validates user-supplied HTTP header key/value pairs before enqueue so invalid headers fail fast instead of failing later at delivery.

Types

This section is empty.

Jump to

Keyboard shortcuts

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