valyala / fasthttp

Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http
MIT License
21.94k stars 1.76k forks source link

Fix header parser (#1808) #1810

Closed ksw2000 closed 4 months ago

ksw2000 commented 4 months ago

See issue #1808. When FastHTTP receives a header value suffixed or prefixed with tabs, they should be stripped.

ksw2000 commented 4 months ago

I have added tests for the parser of ResponseHeader and RequestHeader. Before making code changes, TestIssue1808 could not pass. Additionally, my ground truth is compared against the parsing results of Go's built-in net/http package, which means our parser handles tabs in the same way as Go's built-in parser.

When I made the pull request, there was one test that did not pass, but in my opinion, it is unrelated to the changes I made.

erikdubbelboer commented 4 months ago

Thanks!