strip trailing and leading linear whitespace in headers
commit1b31c40997ff8b932a457275e9a2f219de1d32c8
authorEric Wong <normalperson@yhbt.net>
Mon, 23 May 2011 21:04:56 +0000 (23 21:04 +0000)
committerEric Wong <normalperson@yhbt.net>
Mon, 23 May 2011 21:04:56 +0000 (23 21:04 +0000)
treeba36c1c8feeb3a962b6039a98105df8b06e504c9
parent947704e3f8e67b8262815838e87b331802c7ba67
strip trailing and leading linear whitespace in headers

RFC 2616, section 4.2:
> The field-content does not include any leading or trailing LWS:
> 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. Such leading or trailing LWS MAY be
> removed without changing the semantics of the field value. Any LWS
> that occurs between field-content MAY be replaced with a single SP
> before interpreting the field value or forwarding the message
> downstream.
ext/unicorn_http/unicorn_http.rl
test/unit/test_http_parser.rb