a Secarta project ...

HTTPsec Authentication Protocol


Preamble

6.2. Header Canonicalization

The values of various HTTP headers [HTTP][ 4.2] other than the protocol headers also feature in protocol computations, notably the signature and message authentication codes. The values of these headers MUST first undergo the following canonicalization transformations, applied in strict order:

  1. Retrieve the header's literal US-ASCII encoded field-value, including any quotes;
  2. Remove all whitespace;
  3. Remove leading or trailing substrings consisting only of semicolons (";") and/or commas (",")
  4. Replace with a single semicolon (";") any internal substring that consists only of semicolons (";") and/or commas (",").

For example, the (albeit unlikely) header field-value ";foo,, ; bar;; foo bar;" becomes "foo;bar;foobar".

Note that this canonicalization is strictly a pre-processing step for the purpose of protocol computations only. It is not a constraint on the actual header field-values that may appear in a message.