You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by ji...@apache.org on 2004/04/17 18:23:30 UTC

[jira] Closed: (CACTUS-13) org.apache.cactus.ServletURL getHost() method returns : with value

Message:

   The following issue has been closed.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/CACTUS-13

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: CACTUS-13
    Summary: org.apache.cactus.ServletURL getHost() method returns : with value
       Type: Bug

     Status: Closed
   Priority: Major
 Resolution: FIXED

    Project: Cactus
 Components: 
             Framework
   Fix Fors:
             1.3

   Assignee: Vincent Massol
   Reporter: Chris Hazen

    Created: Thu, 1 Nov 2001 7:23 AM
    Updated: Sat, 17 Apr 2004 9:22 AM
Environment: Operating System: Windows NT/2K
Platform: PC

Description:
The getHost method of the ServletURL class returns the ":" signifing the start 
of the port number of the host. This has side effects in Cactus in that passing 
in the host name and port into the WebRequest method as "127.0.0.1:7001" will 
cause Cactus to use this url "http://127.0.0.1::7001". This may be a bug with 
classes that are using the ServletURL. 

Solution: Remove the port number from the host.
    public String getHost()
    {
        int pos = m_URL_ServerName.indexOf(":");
        if (pos > 0) {
            //instead of pos + 1, just use the pos
            return m_URL_ServerName.substring(0, pos );
        }

        return m_URL_ServerName;
    }


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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