Uploaded image for project: 'Commons Validator'
  1. Commons Validator
  2. VALIDATOR-288

UrlValidator does not validate URL with simple domains (eg: http://hostname )

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3.1 Release
    • 1.4.0 Release
    • Routines
    • None

    Description

      A Url of the form "http://hostname" is not validated, when the hostname is simple, i.e does not have any dots.

      I think this is a valid URL and it should pass validation.

      The bug is in UrlValidator::isValidAuthority(), line 382

      String topLevel = domainSegment[segmentCount - 1];
      if (topLevel.length() < 2 || topLevel.length() > 4)

      { return false; }

      In this case, topLevel = "hostname"

      Attachments

        1. VALIDATOR-288-testcase.patch
          2 kB
          Jacob Zwiers

        Activity

          People

            Unassigned Unassigned
            feroze feroze daud
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: