Skip to content

Commit af606fd

Browse files
committed
Add additional URI edge cases and include them in v1
1 parent 20f4897 commit af606fd

File tree

6 files changed

+180
-0
lines changed

6 files changed

+180
-0
lines changed

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,36 @@
197197
"comment": "RFC 3986, Section 3.2.2: Fallback to reg-name allows digits and dots.",
198198
"data": "http://999.999.999.999/",
199199
"valid": true
200+
},
201+
{
202+
"description": "invalid percent-encoding with non-hex digits",
203+
"data": "http://example.com/%6G",
204+
"valid": false
205+
},
206+
{
207+
"description": "incomplete percent-encoding triplet",
208+
"data": "http://example.com/%A",
209+
"valid": false
210+
},
211+
{
212+
"description": "lone percent sign is invalid",
213+
"data": "http://example.com/%",
214+
"valid": false
215+
},
216+
{
217+
"description": "scheme must start with a letter",
218+
"data": "1http://example.com",
219+
"valid": false
220+
},
221+
{
222+
"description": "invalid character in scheme",
223+
"data": "ht_tp://example.com",
224+
"valid": false
225+
},
226+
{
227+
"description": "non-numeric port is invalid",
228+
"data": "http://example.com:abc/path",
229+
"valid": false
200230
}
201231
]
202232
}

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,36 @@
197197
"comment": "RFC 3986, Section 3.2.2: Fallback to reg-name allows digits and dots.",
198198
"data": "http://999.999.999.999/",
199199
"valid": true
200+
},
201+
{
202+
"description": "invalid percent-encoding with non-hex digits",
203+
"data": "http://example.com/%6G",
204+
"valid": false
205+
},
206+
{
207+
"description": "incomplete percent-encoding triplet",
208+
"data": "http://example.com/%A",
209+
"valid": false
210+
},
211+
{
212+
"description": "lone percent sign is invalid",
213+
"data": "http://example.com/%",
214+
"valid": false
215+
},
216+
{
217+
"description": "scheme must start with a letter",
218+
"data": "1http://example.com",
219+
"valid": false
220+
},
221+
{
222+
"description": "invalid character in scheme",
223+
"data": "ht_tp://example.com",
224+
"valid": false
225+
},
226+
{
227+
"description": "non-numeric port is invalid",
228+
"data": "http://example.com:abc/path",
229+
"valid": false
200230
}
201231
]
202232
}

tests/draft4/optional/format/uri.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,36 @@
194194
"comment": "RFC 3986, Section 3.2.2: Fallback to reg-name allows digits and dots.",
195195
"data": "http://999.999.999.999/",
196196
"valid": true
197+
},
198+
{
199+
"description": "invalid percent-encoding with non-hex digits",
200+
"data": "http://example.com/%6G",
201+
"valid": false
202+
},
203+
{
204+
"description": "incomplete percent-encoding triplet",
205+
"data": "http://example.com/%A",
206+
"valid": false
207+
},
208+
{
209+
"description": "lone percent sign is invalid",
210+
"data": "http://example.com/%",
211+
"valid": false
212+
},
213+
{
214+
"description": "scheme must start with a letter",
215+
"data": "1http://example.com",
216+
"valid": false
217+
},
218+
{
219+
"description": "invalid character in scheme",
220+
"data": "ht_tp://example.com",
221+
"valid": false
222+
},
223+
{
224+
"description": "non-numeric port is invalid",
225+
"data": "http://example.com:abc/path",
226+
"valid": false
197227
}
198228
]
199229
}

tests/draft6/optional/format/uri.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,36 @@
194194
"comment": "RFC 3986, Section 3.2.2: Fallback to reg-name allows digits and dots.",
195195
"data": "http://999.999.999.999/",
196196
"valid": true
197+
},
198+
{
199+
"description": "invalid percent-encoding with non-hex digits",
200+
"data": "http://example.com/%6G",
201+
"valid": false
202+
},
203+
{
204+
"description": "incomplete percent-encoding triplet",
205+
"data": "http://example.com/%A",
206+
"valid": false
207+
},
208+
{
209+
"description": "lone percent sign is invalid",
210+
"data": "http://example.com/%",
211+
"valid": false
212+
},
213+
{
214+
"description": "scheme must start with a letter",
215+
"data": "1http://example.com",
216+
"valid": false
217+
},
218+
{
219+
"description": "invalid character in scheme",
220+
"data": "ht_tp://example.com",
221+
"valid": false
222+
},
223+
{
224+
"description": "non-numeric port is invalid",
225+
"data": "http://example.com:abc/path",
226+
"valid": false
197227
}
198228
]
199229
}

tests/draft7/optional/format/uri.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,36 @@
194194
"comment": "RFC 3986, Section 3.2.2: Fallback to reg-name allows digits and dots.",
195195
"data": "http://999.999.999.999/",
196196
"valid": true
197+
},
198+
{
199+
"description": "invalid percent-encoding with non-hex digits",
200+
"data": "http://example.com/%6G",
201+
"valid": false
202+
},
203+
{
204+
"description": "incomplete percent-encoding triplet",
205+
"data": "http://example.com/%A",
206+
"valid": false
207+
},
208+
{
209+
"description": "lone percent sign is invalid",
210+
"data": "http://example.com/%",
211+
"valid": false
212+
},
213+
{
214+
"description": "scheme must start with a letter",
215+
"data": "1http://example.com",
216+
"valid": false
217+
},
218+
{
219+
"description": "invalid character in scheme",
220+
"data": "ht_tp://example.com",
221+
"valid": false
222+
},
223+
{
224+
"description": "non-numeric port is invalid",
225+
"data": "http://example.com:abc/path",
226+
"valid": false
197227
}
198228
]
199229
}

tests/v1/format/uri.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,36 @@
197197
"comment": "RFC 3986, Section 3.2.2: Fallback to reg-name allows digits and dots.",
198198
"data": "http://999.999.999.999/",
199199
"valid": true
200+
},
201+
{
202+
"description": "invalid percent-encoding with non-hex digits",
203+
"data": "http://example.com/%6G",
204+
"valid": false
205+
},
206+
{
207+
"description": "incomplete percent-encoding triplet",
208+
"data": "http://example.com/%A",
209+
"valid": false
210+
},
211+
{
212+
"description": "lone percent sign is invalid",
213+
"data": "http://example.com/%",
214+
"valid": false
215+
},
216+
{
217+
"description": "scheme must start with a letter",
218+
"data": "1http://example.com",
219+
"valid": false
220+
},
221+
{
222+
"description": "invalid character in scheme",
223+
"data": "ht_tp://example.com",
224+
"valid": false
225+
},
226+
{
227+
"description": "non-numeric port is invalid",
228+
"data": "http://example.com:abc/path",
229+
"valid": false
200230
}
201231
]
202232
}

0 commit comments

Comments
 (0)