seanmonstar / httparse

A push parser for the HTTP 1.x protocol in Rust.
https://docs.rs/httparse
Apache License 2.0
585 stars 114 forks source link

Exclude trailing whitespace in header value. #48

Closed hannesg closed 6 years ago

hannesg commented 6 years ago

According to rfc7230#section-3.2.4:

The field value does not include any leading or trailing whitespace: OWS occurring before the first non-whitespace octet of the field value or after the last non-whitespace octet of the field value ought to be excluded by parsers when extracting the field value from a header field.

Leading whitespace already gets removed in a loop before parsing the value.

See also https://github.com/hyperium/http/issues/245

seanmonstar commented 6 years ago

Thanks!