Skip to content

Commit 352d71e

Browse files
add passing cases near dotted-decimal IPv4 boundary
1 parent 822fc9e commit 352d71e

File tree

10 files changed

+150
-0
lines changed

10 files changed

+150
-0
lines changed

tests/draft2019-09/optional/format/hostname.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,21 @@
131131
"description": "dotted-decimal IP addresses are not valid hostnames",
132132
"data": "192.168.0.1",
133133
"valid": false
134+
},
135+
{
136+
"description": "numeric labels are allowed in hostnames",
137+
"data": "123.example.com",
138+
"valid": true
139+
},
140+
{
141+
"description": "ipv4-like but last label not purely numeric",
142+
"data": "192.168.0.1a",
143+
"valid": true
144+
},
145+
{
146+
"description": "ipv4-like but first label not purely numeric",
147+
"data": "a192.168.0.1",
148+
"valid": true
134149
}
135150
]
136151
},

tests/draft2019-09/optional/format/idn-hostname.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,21 @@
336336
"description": "dotted-decimal IP addresses are not valid hostnames",
337337
"data": "192.168.0.1",
338338
"valid": false
339+
},
340+
{
341+
"description": "numeric labels are allowed in hostnames",
342+
"data": "123.example.com",
343+
"valid": true
344+
},
345+
{
346+
"description": "ipv4-like but last label not purely numeric",
347+
"data": "192.168.0.1a",
348+
"valid": true
349+
},
350+
{
351+
"description": "ipv4-like but first label not purely numeric",
352+
"data": "a192.168.0.1",
353+
"valid": true
339354
}
340355
]
341356
},

tests/draft2020-12/optional/format/hostname.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,21 @@
131131
"description": "dotted-decimal IP addresses are not valid hostnames",
132132
"data": "192.168.0.1",
133133
"valid": false
134+
},
135+
{
136+
"description": "numeric labels are allowed in hostnames",
137+
"data": "123.example.com",
138+
"valid": true
139+
},
140+
{
141+
"description": "ipv4-like but last label not purely numeric",
142+
"data": "192.168.0.1a",
143+
"valid": true
144+
},
145+
{
146+
"description": "ipv4-like but first label not purely numeric",
147+
"data": "a192.168.0.1",
148+
"valid": true
134149
}
135150
]
136151
},

tests/draft2020-12/optional/format/idn-hostname.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,21 @@
336336
"description": "dotted-decimal IP addresses are not valid hostnames",
337337
"data": "192.168.0.1",
338338
"valid": false
339+
},
340+
{
341+
"description": "numeric labels are allowed in hostnames",
342+
"data": "123.example.com",
343+
"valid": true
344+
},
345+
{
346+
"description": "ipv4-like but last label not purely numeric",
347+
"data": "192.168.0.1a",
348+
"valid": true
349+
},
350+
{
351+
"description": "ipv4-like but first label not purely numeric",
352+
"data": "a192.168.0.1",
353+
"valid": true
339354
}
340355
]
341356
},

tests/draft4/optional/format/hostname.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,21 @@
142142
"description": "dotted-decimal IP addresses are not valid hostnames",
143143
"data": "192.168.0.1",
144144
"valid": false
145+
},
146+
{
147+
"description": "numeric labels are allowed in hostnames",
148+
"data": "123.example.com",
149+
"valid": true
150+
},
151+
{
152+
"description": "ipv4-like but last label not purely numeric",
153+
"data": "192.168.0.1a",
154+
"valid": true
155+
},
156+
{
157+
"description": "ipv4-like but first label not purely numeric",
158+
"data": "a192.168.0.1",
159+
"valid": true
145160
}
146161
]
147162
}

tests/draft6/optional/format/hostname.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,21 @@
142142
"description": "dotted-decimal IP addresses are not valid hostnames",
143143
"data": "192.168.0.1",
144144
"valid": false
145+
},
146+
{
147+
"description": "numeric labels are allowed in hostnames",
148+
"data": "123.example.com",
149+
"valid": true
150+
},
151+
{
152+
"description": "ipv4-like but last label not purely numeric",
153+
"data": "192.168.0.1a",
154+
"valid": true
155+
},
156+
{
157+
"description": "ipv4-like but first label not purely numeric",
158+
"data": "a192.168.0.1",
159+
"valid": true
145160
}
146161
]
147162
}

tests/draft7/optional/format/hostname.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,21 @@
128128
"description": "dotted-decimal IP addresses are not valid hostnames",
129129
"data": "192.168.0.1",
130130
"valid": false
131+
},
132+
{
133+
"description": "numeric labels are allowed in hostnames",
134+
"data": "123.example.com",
135+
"valid": true
136+
},
137+
{
138+
"description": "ipv4-like but last label not purely numeric",
139+
"data": "192.168.0.1a",
140+
"valid": true
141+
},
142+
{
143+
"description": "ipv4-like but first label not purely numeric",
144+
"data": "a192.168.0.1",
145+
"valid": true
131146
}
132147
]
133148
},

tests/draft7/optional/format/idn-hostname.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,21 @@
328328
"description": "dotted-decimal IP addresses are not valid hostnames",
329329
"data": "192.168.0.1",
330330
"valid": false
331+
},
332+
{
333+
"description": "numeric labels are allowed in hostnames",
334+
"data": "123.example.com",
335+
"valid": true
336+
},
337+
{
338+
"description": "ipv4-like but last label not purely numeric",
339+
"data": "192.168.0.1a",
340+
"valid": true
341+
},
342+
{
343+
"description": "ipv4-like but first label not purely numeric",
344+
"data": "a192.168.0.1",
345+
"valid": true
331346
}
332347
]
333348
},

tests/v1/format/hostname.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,21 @@
131131
"description": "dotted-decimal IP addresses are not valid hostnames",
132132
"data": "192.168.0.1",
133133
"valid": false
134+
},
135+
{
136+
"description": "numeric labels are allowed in hostnames",
137+
"data": "123.example.com",
138+
"valid": true
139+
},
140+
{
141+
"description": "ipv4-like but last label not purely numeric",
142+
"data": "192.168.0.1a",
143+
"valid": true
144+
},
145+
{
146+
"description": "ipv4-like but first label not purely numeric",
147+
"data": "a192.168.0.1",
148+
"valid": true
134149
}
135150
]
136151
},

tests/v1/format/idn-hostname.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,21 @@
336336
"description": "dotted-decimal IP addresses are not valid hostnames",
337337
"data": "192.168.0.1",
338338
"valid": false
339+
},
340+
{
341+
"description": "numeric labels are allowed in hostnames",
342+
"data": "123.example.com",
343+
"valid": true
344+
},
345+
{
346+
"description": "ipv4-like but last label not purely numeric",
347+
"data": "192.168.0.1a",
348+
"valid": true
349+
},
350+
{
351+
"description": "ipv4-like but first label not purely numeric",
352+
"data": "a192.168.0.1",
353+
"valid": true
339354
}
340355
]
341356
},

0 commit comments

Comments
 (0)