6 Commits

Author SHA1 Message Date
Erik Dubbelboer 7760a5b506 Validate request method
Use the same validation as net/http.

Fixes https://github.com/valyala/fasthttp/issues/1803
2024-07-14 09:43:40 +02:00
Erik Dubbelboer b4c0b2b47d Validate header values (#1796)
* Validate header values

Fixes https://github.com/valyala/fasthttp/issues/1794

* Don't allow empty header keys

And improve error handling for bad headers.
2024-07-03 10:04:04 +02:00
Erik Dubbelboer 7b273dc590 Don't allow \r in header names (#1789)
* Don't allow \r in header names

From RFC 9112:

  A sender MUST NOT generate a bare CR (a CR character not immediately
  followed by LF) within any protocol elements other than the content.
  A recipient of such a bare CR MUST consider that element to be invalid
  or replace each bare CR with SP before processing the element or forwarding
  the message.

net/http seems to completely error on this, so let's do the same.

Fixes https://github.com/valyala/fasthttp/issues/1785

* Validate the full header field
2024-06-11 08:41:16 +02:00
nickajacks1 2accefa5cb refactor: move manually created tchar table to bytesconv_table_gen (#1689) 2024-01-07 08:27:45 +01:00
Erik Dubbelboer af531ad4c0 Move comment to now show up on godoc
Comments above the package statement show up at the top of
https://godoc.org/github.com/valyala/fasthttp
2019-10-03 14:08:17 +02:00
ZhangYunHao b1ca43febc Use 'go generate' in bytesconv.go (#663)
* Add bytesconv_table_gen.go
2019-09-28 14:55:31 +02:00