Permalink
Browse files

allow longer authorities in the url, such as "local"

Issue: WICKET-4255


git-svn-id: https://svn.apache.org/repos/asf/wicket/trunk@1205300 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 09166ea commit c250db9c324da4158f55831931401357ac7b1124 Igor Vaynberg committed Nov 23, 2011
View
2 wicket-core/src/main/java/org/apache/wicket/validation/validator/UrlValidator.java
@@ -427,7 +427,7 @@ protected boolean isValidAuthority(String authority)
if (segmentCount > 1)
{
String topLevel = domainSegment[segmentCount - 1];
- if (topLevel.length() < 2 || topLevel.length() > 4)
+ if (topLevel.length() < 2)
{
return false;
}
View
3 wicket-core/src/test/java/org/apache/wicket/validation/validator/UrlValidatorTest.java
@@ -300,7 +300,8 @@ public void testValidateUrl()
new ResultPair("1.2.3", false), new ResultPair(".1.2.3.4", false),
new ResultPair("go.a", false), new ResultPair("go.a1a", true),
new ResultPair("go.1aa", false), new ResultPair("aaa.", false),
- new ResultPair(".aaa", false), new ResultPair("aaa", true)
+ new ResultPair(".aaa", false), new ResultPair("aaa", true),
+ new ResultPair("go.local", true)
/*
* , new ResultPair("", false) In combination with "http:/" + "/test1" the expected result is
* true

0 comments on commit c250db9

Please sign in to comment.