Skip to content

please add a function that does Header Field Normalisation #116

@vanHoesel

Description

@vanHoesel

In order to make comparison of two Header Field values more convenient (and correct) it would be great to have a normalisation function in HTTP::Headers, like:

my $normalized_value = $h->normalized_header( 'accept_language');

Normalisation is mentioned in RFC 7234 §4.1 Calculating Secondary Keys with Vary. And could involve:

  • adding/removing whitespace
  • combining fields, for multi value fields
  • reordering fields
  • capitalisation

However, re-ordering and capitalisation can be Header Field dependent and should not break semantics This requires a lot of care, knowing how certain HTTP-Header Fields south to be treated.

NOTE: bare in mind that normalisation is only for display or comparison, I would strongly disagree to change the headers, even though it might semantically totally right.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions