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

Userinfo without colon should be valid in UrlValidator

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.0
    • Fix Version/s: 1.6
    • Component/s: None
    • Labels:
      None

      Description

      UrlValidator does not accept userinfo without ":".
      The following code returns false.

      UrlValidator validator = new UrlValidator();
      validator.isValid("http://user@www.apache.org:80/path")
      

      But it should be accepted.

      RFC of URI allows userinfo without colon.
      https://tools.ietf.org/html/rfc3986#section-3.2.1

      userinfo = *( unreserved / pct-encoded / sub-delims / ":" )

      RFC of URL also allows it.
      https://tools.ietf.org/html/rfc1738#section-3.1

      //<user>:<password>@<host>:<port>/<url-path>
      Some or all of the parts "<user>:<password>@", ":<password>",
      ":<port>", and "/<url-path>" may be excluded.

      I created Pull Request.
      https://github.com/apache/commons-validator/pull/5

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                shumpei-akai Shumpei Akai
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: