NAME

Uniform::Utils - Shared production-grade utility functions for Uniform ecosystem authors

FUNCTIONS

normalize_http_headers( \%raw_hash )

Accepts a raw hash reference of incoming network parameters and transforms them into a clean, normalized data model based on strict ecosystem validation criteria:

  • Case Insensitivity: All incoming keys are lowercased and bounding whitespace is stripped.

  • Environment Pruning: CGI/PSGI HTTP_ and HTTP- environment prefixes are safely removed.

  • Priority Ranking: Real HTTP header definitions cleanly take precedence over environment-variable duplicates.

  • Array Reduction: Duplicate incoming headers packed into array references are automatically reduced down to the last scalar definition.

  • Security Sandboxing: Keys failing structural validation checks are rejected entirely, filtering out malicious header manipulation or collision vectors.