hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r643138 - /httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java
Date Mon, 31 Mar 2008 20:34:54 GMT
Author: olegk
Date: Mon Mar 31 13:34:50 2008
New Revision: 643138

URL: http://svn.apache.org/viewvc?rev=643138&view=rev
Log:
Handling of all hop-by-hop headers

Modified:
    httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java

Modified: httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java?rev=643138&r1=643137&r2=643138&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java
(original)
+++ httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java
Mon Mar 31 13:34:50 2008
@@ -353,11 +353,16 @@
                     if (response == null) {
                         throw new IllegalStateException("HTTP request is null");
                     }
-                    // Remove connection specific headers
+                    // Remove hop-by-hop headers
                     response.removeHeaders(HTTP.CONTENT_LEN);
                     response.removeHeaders(HTTP.TRANSFER_ENCODING);
                     response.removeHeaders(HTTP.CONN_DIRECTIVE);
                     response.removeHeaders("Keep-Alive");
+                    response.removeHeaders("Proxy-Authenticate");
+                    response.removeHeaders("Proxy-Authorization");
+                    response.removeHeaders("TE");
+                    response.removeHeaders("Trailers");
+                    response.removeHeaders("Upgrade");
                     
                     response.setParams(
                             new DefaultedHttpParams(response.getParams(), this.params));
@@ -615,13 +620,18 @@
                     throw new IllegalStateException("HTTP request is null");
                 }
                 
-                // Remove connection specific headers
+                // Remove hop-by-hop headers
                 request.removeHeaders(HTTP.CONTENT_LEN);
                 request.removeHeaders(HTTP.TRANSFER_ENCODING);
-                request.removeHeaders(HTTP.TARGET_HOST);
                 request.removeHeaders(HTTP.CONN_DIRECTIVE);
-                request.removeHeaders(HTTP.USER_AGENT);
                 request.removeHeaders("Keep-Alive");
+                request.removeHeaders("Proxy-Authenticate");
+                request.removeHeaders("Proxy-Authorization");
+                request.removeHeaders("TE");
+                request.removeHeaders("Trailers");
+                request.removeHeaders("Upgrade");
+                // Remove host header
+                request.removeHeaders(HTTP.TARGET_HOST);
                 
                 HttpHost targetHost = proxyTask.getTarget();
                 



Mime
View raw message