sdroege / rtsp-types

RTSP (RFC 7826) types and parsers/serializers
MIT License
26 stars 13 forks source link

Parser: Trim whitespace from header values in accordance with RFC 9110 #17

Closed nemosupremo closed 1 year ago

nemosupremo commented 1 year ago

This PR trims leading and trailing whitespace on parsed header values. I would have opted to use trim_ascii, however that function is not stabilized for &[u8], so instead I copied their implementation here with comment.

I also considered modifying the parser combinator, but I felt that this approach was much clearer in respect to how the header value was being transformed.

sdroege commented 1 year ago

Don't worry about the clippy warnings, I'll take care of them :) Thanks for the PR, I'll get this merged together with the clippy fixes tomorrow.

sdroege commented 1 year ago

This is now released as 0.0.5 on crates.io