[ 
https://issues.apache.org/jira/browse/NUTCH-2620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16545020#comment-16545020
 ] 

ASF GitHub Bot commented on NUTCH-2620:
---------------------------------------

sebastian-nagel closed pull request #362: [NUTCH-2620] Fix invalid assumption 
in URL validator
URL: https://github.com/apache/nutch/pull/362
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/src/plugin/urlfilter-validator/src/java/org/apache/nutch/urlfilter/validator/UrlValidator.java
 
b/src/plugin/urlfilter-validator/src/java/org/apache/nutch/urlfilter/validator/UrlValidator.java
index 03fca9749..495f698e3 100644
--- 
a/src/plugin/urlfilter-validator/src/java/org/apache/nutch/urlfilter/validator/UrlValidator.java
+++ 
b/src/plugin/urlfilter-validator/src/java/org/apache/nutch/urlfilter/validator/UrlValidator.java
@@ -277,7 +277,7 @@ private boolean isValidAuthority(String authority) {
         segCount++;
       }
       String topLevel = domainSegment[segCount - 1];
-      if (topLevel.length() < 2 || topLevel.length() > 4) {
+      if (topLevel.length() < 2) {
         return false;
       }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> urlfilter-validator incorrectly assumes that top-level domains are not longer 
> than 4 characters
> -----------------------------------------------------------------------------------------------
>
>                 Key: NUTCH-2620
>                 URL: https://issues.apache.org/jira/browse/NUTCH-2620
>             Project: Nutch
>          Issue Type: Bug
>    Affects Versions: 1.15
>            Reporter: Gareth
>            Priority: Major
>              Labels: easyfix
>             Fix For: 1.15
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The code assumes a TLD can be max 4 in length. But this is wrong.
>  
> https://github.com/apache/nutch/blob/f011b2193c24e031aafbcfa1e66fc2bcbb59098b/src/plugin/urlfilter-validator/src/java/org/apache/nutch/urlfilter/validator/UrlValidator.java#L280



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to