In HTTP headers can be multi-line.
For example:
Word-Of-The-Day: The Fox Jumps Over
the brown dog.
However, when reading the standard, I came to the conclusion that leading and trailing whitespace MAY be removed, so we get "The Fox Jumps Overthe brown dog." Overthe becomes one word when really it should've been "Over the" (two words, seperated by whitespace).
How do I handle parsing of HTTP values in situations like this, i.e. how do I concatenate HTTP-multiline headers to mean the same thing as single line headers?
The whitespace before the
is neither leading nor trailing.
Section 4.2 of the standard defines leading/trailing whitespace as "linear white space occurring before the first non-whitespace character of the field-value or after the last non-whitespace character of the field-value". This space is neither before the first character of the field value nor after the last one.
The rule for this kind of linear white space, inside the field value, is that it "MAY be replaced with a single [space] before interpreting the field value or forwarding the message downstream."
So we get "The Fox Jumps Over the brown dog."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With