Instead of injecting spaces to ensure that lines stay under 76 characters only wrap at whitespace characters. This avoids changing the headers.
A best-effort to keep lines under 76 characters is still done, however it is only done at whitespace. Notably there is no hard wrap enforced. This means that it is possible for headers to break the 1000 character line-length limit in the specification. It is just hoped that the receiver will allow long lines in this case.
Closes#688
Co-authored-by: Kevin Cox <kevincox@kevincox.ca>
* Replace hyperx Header and Headers with our own implementation
* Remove utf8_b
* Add RFC 1522 encoder
* Fix most tests
* Throw away old tests
* Header encoding tests
* Fix slicing in the middle of a char
* Content-Disposition after rebase
* Fix the rest of the tests
* Fix useless clone clippy warnings
* Remove Headers::get_raw_mut
* HeaderName::new_from_ascii fallible API
* Tidy up HeaderName::new_from_ascii_str
* HeaderName::new_from_ascii(_str) tests
Fixes https://tools.ietf.org/tools/msglint/ warning about the
Content-Type header being too long.
I looked at many emails I received over time and I couldn't find
any with a boundary as long as ours, so this isn't only justified
by making some tool happy.