Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a3ff4bf

Browse filesBrowse files
authored
url: revert "validate ipv4 part length"
This reverts commit 87d0d7a. Refs: #42915 PR-URL: #42940 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent f7d658a commit a3ff4bf
Copy full SHA for a3ff4bf

File tree

Expand file treeCollapse file tree

2 files changed

+12
-11
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-11
lines changed
Open diff view settings
Collapse file

‎src/node_url.cc‎

Copy file name to clipboardExpand all lines: src/node_url.cc
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,7 @@ void URLHost::ParseIPv4Host(const char* input, size_t length, bool* is_ipv4) {
411411
const char ch = pointer < end ? pointer[0] : kEOL;
412412
int64_t remaining = end - pointer - 1;
413413
if (ch == '.' || ch == kEOL) {
414-
// If parts’s size is greater than 4, validation error, return failure.
415-
if (++parts > static_cast<int>(arraysize(numbers))) {
416-
*is_ipv4 = true;
417-
return;
418-
}
414+
if (++parts > static_cast<int>(arraysize(numbers))) return;
419415
if (pointer == mark)
420416
return;
421417
int64_t n = ParseNumber(mark, pointer);
Collapse file

‎test/fixtures/wpt/url/resources/urltestdata.json‎

Copy file name to clipboardExpand all lines: test/fixtures/wpt/url/resources/urltestdata.json
+11-6Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5317,12 +5317,17 @@
53175317
{
53185318
"input": "http://256.256.256.256.256",
53195319
"base": "http://other.com/",
5320-
"failure": true
5321-
},
5322-
{
5323-
"input": "http://256.256.256.256.256.",
5324-
"base": "http://other.com/",
5325-
"failure": true
5320+
"href": "http://256.256.256.256.256/",
5321+
"origin": "http://256.256.256.256.256",
5322+
"protocol": "http:",
5323+
"username": "",
5324+
"password": "",
5325+
"host": "256.256.256.256.256",
5326+
"hostname": "256.256.256.256.256",
5327+
"port": "",
5328+
"pathname": "/",
5329+
"search": "",
5330+
"hash": ""
53265331
},
53275332
{
53285333
"input": "https://0x.0x.0",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.