Skip to content

Commit c8b5709

Browse files
committed
test valid single label hostnames
RFC1123 allows single label hostnames with hyphens in between and starting with a digit. Signed-off-by: Stephan Wurm <[email protected]>
1 parent 299aa7f commit c8b5709

File tree

6 files changed

+60
-0
lines changed

6 files changed

+60
-0
lines changed

tests/draft-next/optional/format/hostname.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@
9595
"description": "exceeds maximum label length",
9696
"data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com",
9797
"valid": false
98+
},
99+
{
100+
"description": "single label with hyphen",
101+
"data": "host-name",
102+
"valid": true
103+
},
104+
{
105+
"description": "single label starting with digit",
106+
"data": "1host",
107+
"valid": true
98108
}
99109
]
100110
}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@
9595
"description": "exceeds maximum label length",
9696
"data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com",
9797
"valid": false
98+
},
99+
{
100+
"description": "single label with hyphen",
101+
"data": "host-name",
102+
"valid": true
103+
},
104+
{
105+
"description": "single label starting with digit",
106+
"data": "1host",
107+
"valid": true
98108
}
99109
]
100110
}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@
9595
"description": "exceeds maximum label length",
9696
"data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com",
9797
"valid": false
98+
},
99+
{
100+
"description": "single label with hyphen",
101+
"data": "host-name",
102+
"valid": true
103+
},
104+
{
105+
"description": "single label starting with digit",
106+
"data": "1host",
107+
"valid": true
98108
}
99109
]
100110
}

tests/draft4/optional/format/hostname.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@
9292
"description": "exceeds maximum label length",
9393
"data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com",
9494
"valid": false
95+
},
96+
{
97+
"description": "single label with hyphen",
98+
"data": "host-name",
99+
"valid": true
100+
},
101+
{
102+
"description": "single label starting with digit",
103+
"data": "1host",
104+
"valid": true
95105
}
96106
]
97107
}

tests/draft6/optional/format/hostname.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@
9292
"description": "exceeds maximum label length",
9393
"data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com",
9494
"valid": false
95+
},
96+
{
97+
"description": "single label with hyphen",
98+
"data": "host-name",
99+
"valid": true
100+
},
101+
{
102+
"description": "single label starting with digit",
103+
"data": "1host",
104+
"valid": true
95105
}
96106
]
97107
}

tests/draft7/optional/format/hostname.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@
9292
"description": "exceeds maximum label length",
9393
"data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com",
9494
"valid": false
95+
},
96+
{
97+
"description": "single label with hyphen",
98+
"data": "host-name",
99+
"valid": true
100+
},
101+
{
102+
"description": "single label starting with digit",
103+
"data": "1host",
104+
"valid": true
95105
}
96106
]
97107
}

0 commit comments

Comments
 (0)