Uploaded image for project: 'HttpComponents HttpCore'
  1. HttpComponents HttpCore
  2. HTTPCORE-326

HttpHost class should not add port number if port is default

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.2.2, 4.2.3
    • 4.2.3
    • HttpCore
    • None

    Description

      The following method:

          public String toHostString() {
              if (this.port != -1) {
                  //the highest port number is 65535, which is length 6 with the addition of the colon
                  StringBuilder buffer = new StringBuilder(this.hostname.length() + 6);
                  buffer.append(this.hostname);
                  buffer.append(":");
                  buffer.append(Integer.toString(this.port));
                  return buffer.toString();
              } else {
                  return this.hostname;
              }
          }
      

      ... always appends a port number. Unfortunately, some sites don't accept a port number. See CONNECTORS-604.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kwright@metacarta.com Karl Wright
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: