seanmonstar / httparse

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

Added header function to extract specific value #31

Closed hanscj1 closed 7 years ago

hanscj1 commented 7 years ago

Added a function that supports UniCase and extracts the specific value for a given header.

seanmonstar commented 7 years ago

Thanks for the pull request!

Is there a reason to include this in this crate, instead of just implementing this where one needs it? An issue I see here is that the unicase crate needs std, and httparse tries to work without it.

hanscj1 commented 7 years ago

I'll take a look at doing that in my library. It was just easier at the time. thx

hanscj1 commented 7 years ago

Just curious, I have seen several libraries lately working toward !std, why? thx

seanmonstar commented 7 years ago

I don't have any special interest in bending over backwards to make it work with no_std, but httparse just didn't need anything in std. The benefit is that people can use those libraries on small hardware, where executable size may be important, or access to a heap may not even exist.