You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Karl Wright (JIRA)" <ji...@apache.org> on 2013/01/09 23:02:12 UTC

[jira] [Created] (HTTPCORE-326) HttpHost class should not add port number if port is default

Karl Wright created HTTPCORE-326:
------------------------------------

             Summary: HttpHost class should not add port number if port is default
                 Key: HTTPCORE-326
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-326
             Project: HttpComponents HttpCore
          Issue Type: Bug
          Components: HttpCore
    Affects Versions: 4.2.3, 4.2.2
            Reporter: Karl Wright


The following method:

{code}
    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;
        }
    }
{code}

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



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org