cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1399181 - /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
Date Wed, 17 Oct 2012 11:24:42 GMT
Author: sergeyb
Date: Wed Oct 17 11:24:41 2012
New Revision: 1399181

URL: http://svn.apache.org/viewvc?rev=1399181&view=rev
Log:
Trying HTTPServletRequest.getLocalAddr if getServerName returns 0.0.0.0

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=1399181&r1=1399180&r2=1399181&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 Wed
Oct 17 11:24:41 2012
@@ -271,6 +271,10 @@ public final class HttpUtils {
         boolean absolute = u.isAbsolute();
         if (request != null && (!absolute || u.toString().contains(ANY_IP_ADDRESS_START)))
{
             String serverAndPort = request.getServerName();
+            if (absolute && ANY_IP_ADDRESS.equals(serverAndPort)) {
+                serverAndPort = request.getLocalAddr();
+            }
+                
             int port = request.getLocalPort();
             if (port != DEFAULT_HTTP_PORT) {
                 serverAndPort += ":" + port;



Mime
View raw message