Add Rhino test suite for String email/URL patterns #160
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "test-string-module"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a minimal Rhino test suite for
String.EMAILPATTERNandString.URLPATTERN— the same patterns that caused the ReDoS in #229.Approach
A single
tests/String.test.jsfile runs in the plain Rhino shell (no Helma server needed). A one-liner mock forapp.addRepositoryis enough to load the module; the tests then callString.EMAILPATTERNandString.URLPATTERNdirectly — the same objectsisEmail()andisUrl()delegate to.A new
testJsGradle task runs the suite and is wired intocheck, so it runs as part of every build:No new dependencies. The
rhino-allJAR already in the build is the only runtime.Coverage (95 cases)
!#$%&'*+/=?^_~@, double dot, trailing dot, no host, no scheme[](),;:\x00, CR, LF, tab, NBSP in domain and local partjavascript:,data:,vbscript:,file:, uppercase/mixed-case variantsevil.com\@good.com), backslash in hostname07af6d598cto98510eb147View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.