-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
2 changed files
with
90 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters