Repository navigation
Limit uri-template literals to RFC 6570 characters on 2.x - #1387
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2.x #1387 +/- ##
======================================
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. Stack depth, inherited ( 2. Speed, inherited ( 3. CHANGELOG links ( 4. Duplicate tests ( 5. Sweep gaps, inherited ( 6. Ordering ( |
Formats.java and UriTemplateFormatTest are again identical to networknt#1385: runs of literal characters and varchars are matched possessively, so long templates no longer overflow the stack, and the tests add long-input and stray brace or percent sign cases. The two FormatValidatorTest cases are removed, as UriTemplateFormatTest covers the same inputs. The CHANGELOG entry names 2.0.8 and links networknt#1387, networknt#1385 and networknt#1275, and a Fixed entry covers the stack overflow.
|
|
Review of head What I checked:
One small point: CHANGELOG wording ( |
Port of networknt#1385 to 2.x, together with networknt#1275, which was not backported. The literal class lists RFC 6570 section 2.1's ranges (the ASCII characters, ucschar and iprivate). A space, a backslash, C1 controls, lone surrogates, noncharacters, U+FFF0 to U+FFFD and U+E0000 to U+E0FFF are rejected in a literal. The apostrophe is accepted, as in the JSON-Schema-Test-Suite and on master, so both branches agree on uri-template. The vendored uri-template.json suite files are updated.
Formats.java and UriTemplateFormatTest are again identical to networknt#1385: runs of literal characters and varchars are matched possessively, so long templates no longer overflow the stack, and the tests add long-input and stray brace or percent sign cases. The two FormatValidatorTest cases are removed, as UriTemplateFormatTest covers the same inputs. The CHANGELOG entry names 2.0.8 and links networknt#1387, networknt#1385 and networknt#1275, and a Fixed entry covers the stack overflow.
f262242 to
e663043
Compare
|
Review of head
Ready to merge. |
Port of #1385 to
2.x. #1275 (apostrophes in literals) was never backported, so 2.x rejectsa'bwhile master and the upstream suite accept it. This carries both changes so the two branches agree onuri-template.ucscharandiprivate, plus the apostrophe.Formats.javais identical to master after Limit uri-template literals to RFC 6570 characters #1385.UriTemplateFormatTest, identical to master: every code point checked against the RFC's ABNF, long inputs up to 1,000,000 characters, and the apostrophe.StackOverflowError.uri-template.jsonsuite files, as on master.Merge #1385 first; this branch is refreshed whenever #1385 changes.
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.