Commit 02cff4a
url: improve url.parse() compliance with WHATWG URL
Make the url.parse() hostname parsing closer to that of WHATWG URL
parsing. This mitigates for cases where hostname spoofing becomes
possible if your code checks the hostname using one API but the library
you use to send the request uses the other API.
Concerns about hostname-spoofing were raised and presented in excellent
detail by pyozzi-toss (pyozzi@toss.im/Security-Tech Team in Toss).
PR-URL: #45011
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>1 parent 025e616 commit 02cff4aCopy full SHA for 02cff4a
File tree
Expand file treeCollapse file tree
2 files changed
+28
-26
lines changedOpen diff view settings
Filter options
- lib
- test/parallel
Expand file treeCollapse file tree
2 files changed
+28
-26
lines changedOpen diff view settings
Collapse file
+7-20Lines changed: 7 additions & 20 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
128 | 128 | |
129 | 129 | |
130 | 130 | |
131 | | - |
132 | | - |
133 | | - |
134 | | - |
135 | | - |
136 | | - |
137 | | - |
138 | | - |
139 | | - |
140 | | - |
141 | 131 | |
142 | 132 | |
143 | 133 | |
| ||
147 | 137 | |
148 | 138 | |
149 | 139 | |
| 140 | + |
150 | 141 | |
151 | 142 | |
152 | 143 | |
| ||
514 | 505 | |
515 | 506 | |
516 | 507 | |
517 | | - |
518 | | - |
519 | | - |
520 | | - |
521 | | - |
522 | | - |
523 | | - |
524 | | - |
525 | | - |
526 | | - |
| 508 | + |
| 509 | + |
| 510 | + |
| 511 | + |
| 512 | + |
| 513 | + |
527 | 514 | |
528 | 515 | |
529 | 516 | |
|
Collapse file
test/parallel/test-url-parse-format.js
Copy file name to clipboardExpand all lines: test/parallel/test-url-parse-format.js+21-6Lines changed: 21 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
885 | 885 | |
886 | 886 | |
887 | 887 | |
888 | | - |
| 888 | + |
889 | 889 | |
890 | | - |
| 890 | + |
891 | 891 | |
892 | 892 | |
893 | 893 | |
894 | | - |
895 | | - |
896 | | - |
| 894 | + |
| 895 | + |
| 896 | + |
897 | 897 | |
898 | 898 | |
899 | 899 | |
| ||
991 | 991 | |
992 | 992 | |
993 | 993 | |
994 | | - |
| 994 | + |
| 995 | + |
| 996 | + |
| 997 | + |
| 998 | + |
| 999 | + |
| 1000 | + |
| 1001 | + |
| 1002 | + |
| 1003 | + |
| 1004 | + |
| 1005 | + |
| 1006 | + |
| 1007 | + |
| 1008 | + |
| 1009 | + |
995 | 1010 | |
996 | 1011 | |
997 | 1012 | |
|
0 commit comments