hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Corneille (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HTTPCORE-337) Example Fix: NIO Reverse Proxy Server Example
Date Wed, 24 Apr 2013 02:17:16 GMT
Mike Corneille created HTTPCORE-337:
---------------------------------------

             Summary: Example Fix: NIO Reverse Proxy Server Example
                 Key: HTTPCORE-337
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-337
             Project: HttpComponents HttpCore
          Issue Type: Bug
          Components: Examples
    Affects Versions: 4.2.4
            Reporter: Mike Corneille
            Priority: Minor


Problem: The 302 redirect doesn't work because the "location" header isn't properly transposed.
By copying all headers from the origin to the client respolves the 302 problem.  There could
be other issues with simply transposing all headers, but this is a good fix to add for now...

Examples found on page:
http://hc.apache.org/httpcomponents-core-ga/examples.html

http://hc.apache.org/httpcomponents-core-ga/httpcore-nio/examples/org/apache/http/examples/nio/NHttpReverseProxy.java

@@ -46,6 +46,8 @@ class ProxyResponseProducer implements HttpAsyncResponseProducer
             // Rewrite response!!!!
             BasicHttpResponse r = new BasicHttpResponse(response.getStatusLine());
 
+            r.setHeaders(response.getAllHeaders());
+
             r.setEntity(response.getEntity());
             return r;
         }


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message