cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1244128 - /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
Date Tue, 14 Feb 2012 17:07:22 GMT
Author: sergeyb
Date: Tue Feb 14 17:07:21 2012
New Revision: 1244128

URL: http://svn.apache.org/viewvc?rev=1244128&view=rev
Log:
[CXf-4109] Removing a reference to URI.getHost()

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java?rev=1244128&r1=1244127&r2=1244128&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java Tue
Feb 14 17:07:21 2012
@@ -57,6 +57,7 @@ public final class HttpUtils {
     private static final Logger LOG = LogUtils.getL7dLogger(HttpUtils.class);
     
     private static final String ANY_IP_ADDRESS = "0.0.0.0";
+    private static final String ANY_IP_ADDRESS_START = "://0.0.0.0";
     private static final int DEFAULT_HTTP_PORT = 80;
     
     private static final Pattern ENCODE_PATTERN = Pattern.compile("%[0-9a-fA-F][0-9a-fA-F]");
@@ -186,7 +187,7 @@ public final class HttpUtils {
         HttpServletRequest request = 
             (HttpServletRequest)message.get(AbstractHTTPDestination.HTTP_REQUEST);
         boolean absolute = u.isAbsolute();
-        if (request != null && (!absolute || u.getHost().equals(ANY_IP_ADDRESS)))
{
+        if (request != null && (!absolute || u.toString().contains(ANY_IP_ADDRESS_START)))
{
             String serverAndPort = request.getServerName();
             int port = request.getLocalPort();
             if (port != DEFAULT_HTTP_PORT) {



Mime
View raw message