Commit Graph

6 Commits

Author SHA1 Message Date
Steven Scott a51a35ae32 Improve header parsing code
Because the net/http server removes \r\n from multi-line header values,
there's no need to to check for \r or \n when skipping whitespace in
headers (see https://godoc.org/net/textproto#Reader.ReadMIMEHeader).
Given this fact, the whitespace test can be simplified to b == ' ' || b
== '\t'.  There's no need for the isSpaceOctet bit field in octetTypes.

The isTokenOctet bit field is the only bit field remaining after the
removal of isSpaceOctet.  Simplify the code by replacing the
isTokenOctet bit test in octetTypes with an array of booleans called
isTokenOctet.

Declare isTokenOctet as a composite literal instead of constructing it
at runtime.

Add documentation to core functions for parsing HTTP headers.
2018-10-06 11:35:33 -04:00
Gary Burd c55883f973
Add parseExtensions test case (#310) 2017-12-05 11:45:40 -08:00
Gary Burd 447c2df769 Compare request header tokens with ASCII case folding
Compare request header tokens with ASCII case folding per the WebSocket
RFC.
2017-11-22 23:15:27 -08:00
Gary Burd 3da6ca0cb6 Simplify and fix spelling errors in test files
Simplify using gofmt -s.
2017-11-02 08:08:30 -07:00
Gary Burd 8b29b78138 Add Sec-WebSocket-Extensions header parser
Also, improve token list header parser.
2016-05-31 09:32:45 -07:00
Gary Burd 9007e29a7c Add test for function tokenListContainsValue 2014-11-17 04:16:34 -08:00