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

Add an option to allow 'localhost' as a valid hostname part in the URL

    XMLWordPrintableJSON

Details

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

    Description

      Working on Grails we've discovered (http://jira.codehaus.org/browse/GRAILS-1692) that commons-validator's UrlValidator rejects URLs like "http://localhost:8080/tau_gwi_00/clif/cb/19". I looked at commons-validator sources and found that any URL which contains 'localhost' as it's hostname part will be rejected.

      RFC-2396 (http://www.ietf.org/rfc/rfc2396.txt) accepts 'localhost' as a valid hostname (appendix G.3 paragraph 2 says that explicitly).

      So, it would be good to have additional option (UrlValidator.ALLOW_LOCALHOST) which will control UrlValidator behavior on localhost URLs.

      Attachments

        1. commons-validator-allow-localhost-r592416.patch
          5 kB
          Sergey Nebolsin
        2. commons-validator-allow-non-iana-tlds-r592416.patch
          6 kB
          Sergey Nebolsin
        3. VALIDATOR-248-refactoring.patch
          6 kB
          Niall Pemberton

        Issue Links

          Activity

            People

              bens Ben Speakmon
              nebolsin Sergey Nebolsin
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: