Commit dafdc0a
http: validate headers in writeEarlyHints
Add validateHeaderName/validateHeaderValue checks for non-link
headers and checkInvalidHeaderChar for the Link value in HTTP/1.1
writeEarlyHints, closing a CRLF injection gap where header names
and values were concatenated into the raw response without
validation.
Also tighten linkValueRegExp to reject CR/LF inside the <...>
URL portion of Link header values.
PR-URL: #61897
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>1 parent aee2a18 commit dafdc0aCopy full SHA for dafdc0a
3 files changed
+52-2Lines changed: 52 additions & 2 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- lib
- internal
- test/parallel
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+10-1Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
53 | 53 | |
54 | 54 | |
55 | 55 | |
| 56 | + |
| 57 | + |
56 | 58 | |
57 | 59 | |
58 | 60 | |
| ||
331 | 333 | |
332 | 334 | |
333 | 335 | |
| 336 | + |
| 337 | + |
| 338 | + |
| 339 | + |
334 | 340 | |
335 | 341 | |
336 | 342 | |
337 | 343 | |
338 | 344 | |
339 | 345 | |
340 | | - |
| 346 | + |
| 347 | + |
| 348 | + |
| 349 | + |
341 | 350 | |
342 | 351 | |
343 | 352 | |
|
Collapse file
+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
509 | 509 | |
510 | 510 | |
511 | 511 | |
512 | | - |
| 512 | + |
513 | 513 | |
514 | 514 | |
515 | 515 | |
|
Collapse file
test/parallel/test-http-early-hints-invalid-argument.js
Copy file name to clipboardExpand all lines: test/parallel/test-http-early-hints-invalid-argument.js+41Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
47 | 47 | |
48 | 48 | |
49 | 49 | |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
0 commit comments