tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/facade HttpServletResponseFacade.java
Date Tue, 18 Jul 2000 00:22:01 GMT
craigmcc    00/07/17 17:22:01

  Modified:    src/share/org/apache/tomcat/facade
                        HttpServletResponseFacade.java
  Log:
  Work around a bug in java.net.URL.getHost() that can return -1 (instead of
  the default port number of 80) when no port is specified in the URL.  Among
  other things, this would cause URL rewriting not to work when you are using
  port 80 (which is typical of many Apache+Tomcat installations).
  
  Revision  Changes    Path
  1.9       +7 -4      jakarta-tomcat/src/share/org/apache/tomcat/facade/HttpServletResponseFacade.java
  
  Index: HttpServletResponseFacade.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/facade/HttpServletResponseFacade.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- HttpServletResponseFacade.java	2000/07/11 03:48:45	1.8
  +++ HttpServletResponseFacade.java	2000/07/18 00:22:01	1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/facade/HttpServletResponseFacade.java,v
1.8 2000/07/11 03:48:45 alex Exp $
  - * $Revision: 1.8 $
  - * $Date: 2000/07/11 03:48:45 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/facade/HttpServletResponseFacade.java,v
1.9 2000/07/18 00:22:01 craigmcc Exp $
  + * $Revision: 1.9 $
  + * $Date: 2000/07/18 00:22:01 $
    *
    * ====================================================================
    *
  @@ -355,7 +355,10 @@
           if (urlPort == -1) {
               urlPort = 80;
           }
  -	if (request.getServerPort() != urlPort)
  +	int serverPort = request.getServerPort();
  +	if (serverPort == -1)	// Work around bug in java.net.URL.getHost()
  +	    serverPort = 80;
  +	if (serverPort != urlPort)
   	    return (false);
   	String contextPath = request.getContext().getPath();
   	if ((contextPath != null) && (contextPath.length() > 0)) {
  
  
  

Mime
View raw message