Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please add a function that does Header Field Normalisation #116

Open
vanHoesel opened this issue Jul 12, 2018 · 2 comments
Open

please add a function that does Header Field Normalisation #116

vanHoesel opened this issue Jul 12, 2018 · 2 comments

Comments

@vanHoesel
Copy link
Member

vanHoesel commented Jul 12, 2018

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.

@vanHoesel vanHoesel changed the title Request for Header Field Normalisation please add a function that does Header Field Normalisation Jul 12, 2018
@vanHoesel
Copy link
Member Author

please close #60

@kjetilk
Copy link

kjetilk commented Jul 13, 2018

Great, thanks a lot for reformulating the issue! It would be really great to have in there!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants