cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asold...@apache.org
Subject svn commit: r1174824 - /cxf/trunk/rt/frontend/jaxws/src/main/jaxws22/org/apache/cxf/transport/http_jaxws_spi/HttpServletRequestAdapter.java
Date Fri, 23 Sep 2011 15:05:12 GMT
Author: asoldano
Date: Fri Sep 23 15:05:12 2011
New Revision: 1174824

URL: http://svn.apache.org/viewvc?rev=1174824&view=rev
Log:
[CXF-3787] Applying patch from Magesh Kumar Bojan to the http_jaxws_spi HttpServletRequestAdapter

Modified:
    cxf/trunk/rt/frontend/jaxws/src/main/jaxws22/org/apache/cxf/transport/http_jaxws_spi/HttpServletRequestAdapter.java

Modified: cxf/trunk/rt/frontend/jaxws/src/main/jaxws22/org/apache/cxf/transport/http_jaxws_spi/HttpServletRequestAdapter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/jaxws22/org/apache/cxf/transport/http_jaxws_spi/HttpServletRequestAdapter.java?rev=1174824&r1=1174823&r2=1174824&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/jaxws22/org/apache/cxf/transport/http_jaxws_spi/HttpServletRequestAdapter.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/jaxws22/org/apache/cxf/transport/http_jaxws_spi/HttpServletRequestAdapter.java
Fri Sep 23 15:05:12 2011
@@ -333,15 +333,20 @@ class HttpServletRequestAdapter implemen
         StringBuffer sb = new StringBuffer();
         sb.append(exchange.getScheme());
         sb.append("://");
-        InetSocketAddress la = exchange.getLocalAddress();
-        if (la != null) {
-            sb.append(la.getHostName());
-            if (la.getPort() > 0) {
-                sb.append(":");
-                sb.append(la.getPort());
-            }
+        String host = this.getHeader("Host");
+        if (host != null) {
+            sb.append(host);
         } else {
-            sb.append("localhost");
+            InetSocketAddress la = exchange.getLocalAddress();
+            if (la != null) {
+                sb.append(la.getHostName());
+                if (la.getPort() > 0) {
+                    sb.append(":");
+                    sb.append(la.getPort());
+                }
+            } else {
+                sb.append("localhost");
+            }
         }
         sb.append(exchange.getContextPath());
         sb.append(context.getPath());



Mime
View raw message