Repository navigation
Reject a trailing label separator in idn-hostname on 2.x - #1386
Conversation
Port of networknt#1384 to 2.x. The JSON-Schema-Test-Suite treats a trailing label separator (example., example。, example., example。) as an invalid idn-hostname, and hostname already rejects a trailing dot. networknt#1383 still accepted one trailing separator on 2.x. Reject it, so 2.x and master agree, and re-enable the 16 upstream cases that were disabled for it.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2.x #1386 +/- ##
======================================
Coverage ? 81.31%
Complexity ? 2413
======================================
Files ? 210
Lines ? 7478
Branches ? 1409
======================================
Hits ? 6081
Misses ? 959
Partials ? 438 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Review of head 1. Wrong version in the entry ( 2. Leading and doubled separators are not mentioned ( 3. Link ( 4. No format-level test ( |
…t class The entry names 2.0.8, the latest 2.x release, which skipped empty labels: .example, a..b and example. were all valid there. It now covers leading and doubled separators too, and links networknt#1386 and networknt#1384. Also ports the networknt#1384 review changes: the isValid Javadoc lists the rules, and idnHostnameFormatRejectsTrailingLabelSeparator checks the IdnHostnameFormat contract directly.
RFC5892Test passes, all 360 enabled idn-hostname suite cases pass, and the changed files compile with |
Port of #1384 to
2.x, so 2.x and master agree onexample.after #1383.RFC5892.isValidno longer drops a trailing empty label, soexample.,example。,example.andexample。are rejected.labelCountis removed.idn-hostname.jsonfiles.RFC5892Test:acceptsAtMostOneTrailingLabelSeparatorbecomesrejectsTrailingLabelSeparators(four separators x three label kinds), and the 253-character test expectsname253 + "."to be invalid.idnHostnameFormatRejectsTrailingLabelSeparatorchecksIdnHostnameFormatdirectly.RFC5892.javais identical to master after #1384, including its review changes. The test file keeps 2.x's Java 8 adaptations.Tested on Java 24: the 74 GraalJS regex test errors (
Unsafe.ensureClassInitializedwas removed in Java 22) also occur on2.xwithout this change; every other test passes.