You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/04/12 18:37:49 UTC

svn commit: r393499 - /incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpMarshaler.java

Author: gnodet
Date: Wed Apr 12 09:37:44 2006
New Revision: 393499

URL: http://svn.apache.org/viewcvs?rev=393499&view=rev
Log:
SM-392: Additional CGI Header in HttpConnector Component

Modified:
    incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpMarshaler.java

Modified: incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpMarshaler.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpMarshaler.java?rev=393499&r1=393498&r2=393499&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpMarshaler.java (original)
+++ incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpMarshaler.java Wed Apr 12 09:37:44 2006
@@ -40,6 +40,11 @@
  */
 public class HttpMarshaler extends MarshalerSupport {
 
+    public static final String REMOTE_ADDRESS = "REMOTE_ADDR";
+    public static final String REMOTE_HOST = "REMOTE_HOST";
+    public static final String REMOTE_USER = "REMOTE_USER";
+    public static final String REQUEST_URI = "REQUEST_URI";
+    
     protected static final Source EMPTY_CONTENT = new StringSource("<payload/>");
 
     private String contentType = "text/xml";
@@ -89,6 +94,10 @@
             String value = request.getHeader(name);
             exchange.setProperty(name, value);
         }
+        exchange.setProperty(REMOTE_ADDRESS, request.getRemoteAddr());
+        exchange.setProperty(REMOTE_HOST, request.getRemoteHost());
+        exchange.setProperty(REMOTE_USER, request.getRemoteUser());
+        exchange.setProperty(REQUEST_URI, request.getRequestURL());
     }
     
     protected void addHttpHeaders(HttpServletResponse response, NormalizedMessage normalizedMessage) {
@@ -107,8 +116,8 @@
      */
     protected boolean shouldIncludeHeader(NormalizedMessage normalizedMessage, String name, Object value) {
         return value instanceof String && 
-        		!"Content-Length".equalsIgnoreCase(name) &&
-        		!"Content-Type".equalsIgnoreCase(name);
+                !"Content-Length".equalsIgnoreCase(name) &&
+                !"Content-Type".equalsIgnoreCase(name);
     }
 
 }