-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http: lenient header value parsing flag
Introduce `llhttp_set_lenient` API method for enabling/disabling lenient parsing mode for header value. With lenient parsing on - no token check would be performed on the header value. This mode was originally introduced to http-parser in nodejs/http-parser@e2e467b9 in order to provide a fallback mode for less compliant clients/servers. PR-URL: #33 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
- Loading branch information
Showing
8 changed files
with
91 additions
and
8 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
Lenient header value parsing | ||
============================ | ||
|
||
Parsing with header value token checks off. | ||
|
||
## Header value with lenient | ||
|
||
<!-- meta={"type": "request-lenient"} --> | ||
```http | ||
GET /url HTTP/1.1 | ||
Header1: \f | ||
``` | ||
|
||
```log | ||
off=0 message begin | ||
off=4 len=4 span[url]="/url" | ||
off=19 len=7 span[header_field]="Header1" | ||
off=28 len=1 span[header_value]="\f" | ||
off=33 headers complete method=1 v=1/1 flags=100 content_length=0 | ||
off=33 message complete | ||
``` | ||
|
||
## Header value without lenient | ||
|
||
<!-- meta={"type": "request"} --> | ||
```http | ||
GET /url HTTP/1.1 | ||
Header1: \f | ||
``` | ||
|
||
```log | ||
off=0 message begin | ||
off=4 len=4 span[url]="/url" | ||
off=19 len=7 span[header_field]="Header1" | ||
off=28 error code=10 reason="Invalid header value char" | ||
``` |