You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by sg...@apache.org on 2005/08/11 18:26:33 UTC

svn commit: r231479 - /portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java

Author: sgala
Date: Thu Aug 11 09:26:27 2005
New Revision: 231479

URL: http://svn.apache.org/viewcvs?rev=231479&view=rev
Log:
partial fix (only works when the servlet container believes it is serving ports 80 and 443) for the problem about secure URLs in http://issues.apache.org/jira/browse/JS2-275 . This is the patch I posted there.

Modified:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java?rev=231479&r1=231478&r2=231479&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java Thu Aug 11 09:26:27 2005
@@ -93,23 +93,19 @@
         this.serverPort = request.getServerPort();
         this.serverScheme = request.getScheme();
         this.secure = request.isSecure();
-        StringBuffer buffer = new StringBuffer(this.serverScheme);
-        buffer.append("://");
-        buffer.append(this.serverName);
-        if ((this.serverScheme.equals(HTTP) && this.serverPort != 80) ||
-                (this.serverScheme.equals(HTTPS) && this.serverPort != 443))
-        {
-            buffer.append(":");
-            buffer.append(this.serverPort);
-        }
-        if ( secure )
-        {
-            this.secureBaseURL = buffer.toString();
-        }
-        else
-        {
-            this.nonSecureBaseURL = buffer.toString();
-        }
+        StringBuffer buffer;
+	
+        buffer = new StringBuffer(HTTPS);
+	buffer.append("://").append(this.serverName);
+	if(this.serverPort != 443 && this.serverPort != 80)
+	    buffer.append(":").append(this.serverPort);
+	this.secureBaseURL = buffer.toString();
+	    
+        buffer = new StringBuffer(HTTP);
+        buffer.append("://").append(this.serverName);
+        if(this.serverPort != 443 && this.serverPort != 80)
+             buffer.append(":").append(this.serverPort);
+        this.nonSecureBaseURL = buffer.toString();
     }
     
     protected void decodeBasePath(HttpServletRequest request)
@@ -161,7 +157,7 @@
         // TODO: delivering both secure and non-secure baseURL for PLT.7.1.2
         //       currently only the baseURL as decoded (secure or non-secure) is returned
         //       and the secure parameter is ignored
-        return this.secure ? secureBaseURL : nonSecureBaseURL;
+        return secure ? secureBaseURL : nonSecureBaseURL;
     }
     
     public String getBasePath()



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