You are viewing a plain text version of this content. The canonical link for it is here.
Posted to portalapps-dev@portals.apache.org by wo...@apache.org on 2014/08/24 21:04:32 UTC

svn commit: r1620174 - in /portals/applications/webcontent/trunk: portlets/src/main/java/org/apache/portals/applications/webcontent2/portlet/proxy/ reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/command/ reverse-proxy/src...

Author: woonsan
Date: Sun Aug 24 19:04:31 2014
New Revision: 1620174

URL: http://svn.apache.org/r1620174
Log:
APA-60: locate 30x handlers after headers/cookies adding commands because you can still get headers/cookies on 30x status responses.

Modified:
    portals/applications/webcontent/trunk/portlets/src/main/java/org/apache/portals/applications/webcontent2/portlet/proxy/SimpleReverseProxyPortlet.java
    portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/command/SerializeHttpEntityContentCommand.java
    portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/servlet/SimpleReverseProxyServlet.java

Modified: portals/applications/webcontent/trunk/portlets/src/main/java/org/apache/portals/applications/webcontent2/portlet/proxy/SimpleReverseProxyPortlet.java
URL: http://svn.apache.org/viewvc/portals/applications/webcontent/trunk/portlets/src/main/java/org/apache/portals/applications/webcontent2/portlet/proxy/SimpleReverseProxyPortlet.java?rev=1620174&r1=1620173&r2=1620174&view=diff
==============================================================================
--- portals/applications/webcontent/trunk/portlets/src/main/java/org/apache/portals/applications/webcontent2/portlet/proxy/SimpleReverseProxyPortlet.java (original)
+++ portals/applications/webcontent/trunk/portlets/src/main/java/org/apache/portals/applications/webcontent2/portlet/proxy/SimpleReverseProxyPortlet.java Sun Aug 24 19:04:31 2014
@@ -116,11 +116,11 @@ public class SimpleReverseProxyPortlet e
         InitHttpRequestCommand initHttpRequestCommand = new InitHttpRequestCommand();
         AddHeaderToHttpRequestCommand addHeaderToHttpRequestCommand = new AddHeaderToHttpRequestCommand();
         ExecuteHttpClientCommand executeHttpClientCommand = new ExecuteHttpClientCommand();
-        HandleRedirectionCommand handleRedirectionCommand = new HandleRedirectionCommand();
-        HandleNotModifiedCommand handleNotModifiedCommand = new HandleNotModifiedCommand();
         ResolveContentRewriterCommand resolveContentRewriterCommand = new ResolveContentRewriterCommand();
         AddHeadersToResponseCommand addHeadersToResponseCommand = new AddHeadersToResponseCommand();
         AddCookiesToResponseCommand addCookiesToResponseCommand = new AddCookiesToResponseCommand();
+        HandleRedirectionCommand handleRedirectionCommand = new HandleRedirectionCommand();
+        HandleNotModifiedCommand handleNotModifiedCommand = new HandleNotModifiedCommand();
         SerializeHttpEntityContentCommand serializeHttpEntityContentCommand = new SerializeHttpEntityContentCommand();
 
         processingChain.addCommand(resolveLocalPathCommand);
@@ -130,11 +130,11 @@ public class SimpleReverseProxyPortlet e
         processingChain.addCommand(initHttpRequestCommand);
         processingChain.addCommand(addHeaderToHttpRequestCommand);
         processingChain.addCommand(executeHttpClientCommand);
-        processingChain.addCommand(handleRedirectionCommand);
-        processingChain.addCommand(handleNotModifiedCommand);
         processingChain.addCommand(resolveContentRewriterCommand);
         processingChain.addCommand(addHeadersToResponseCommand);
         processingChain.addCommand(addCookiesToResponseCommand);
+        processingChain.addCommand(handleRedirectionCommand);
+        processingChain.addCommand(handleNotModifiedCommand);
         processingChain.addCommand(serializeHttpEntityContentCommand);
 
         return processingChain;

Modified: portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/command/SerializeHttpEntityContentCommand.java
URL: http://svn.apache.org/viewvc/portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/command/SerializeHttpEntityContentCommand.java?rev=1620174&r1=1620173&r2=1620174&view=diff
==============================================================================
--- portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/command/SerializeHttpEntityContentCommand.java (original)
+++ portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/command/SerializeHttpEntityContentCommand.java Sun Aug 24 19:04:31 2014
@@ -87,7 +87,6 @@ public class SerializeHttpEntityContentC
         Sink sink = context.getRequestContext().getSink();
 
         ContentType contentType = ContentType.getOrDefault(httpEntity);
-        String mimeType = contentType.getMimeType();
         Charset charset = contentType.getCharset();
         String charsetName = StringUtils.defaultIfEmpty((charset != null ? charset.name() : null), getDefaultCharacterEncoding());
 
@@ -146,7 +145,6 @@ public class SerializeHttpEntityContentC
         Sink sink = context.getRequestContext().getSink();
 
         ContentType contentType = ContentType.getOrDefault(httpEntity);
-        String mimeType = contentType.getMimeType();
         Charset charset = contentType.getCharset();
         String charsetName = StringUtils.defaultIfEmpty((charset != null ? charset.name() : null), getDefaultCharacterEncoding());
 

Modified: portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/servlet/SimpleReverseProxyServlet.java
URL: http://svn.apache.org/viewvc/portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/servlet/SimpleReverseProxyServlet.java?rev=1620174&r1=1620173&r2=1620174&view=diff
==============================================================================
--- portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/servlet/SimpleReverseProxyServlet.java (original)
+++ portals/applications/webcontent/trunk/reverse-proxy/src/main/java/org/apache/portals/applications/webcontent2/proxy/servlet/SimpleReverseProxyServlet.java Sun Aug 24 19:04:31 2014
@@ -121,11 +121,11 @@ public class SimpleReverseProxyServlet e
         InitHttpRequestCommand initHttpRequestCommand = new InitHttpRequestCommand();
         AddHeaderToHttpRequestCommand addHeaderToHttpRequestCommand = new AddHeaderToHttpRequestCommand();
         ExecuteHttpClientCommand executeHttpClientCommand = new ExecuteHttpClientCommand();
-        HandleRedirectionCommand handleRedirectionCommand = new HandleRedirectionCommand();
-        HandleNotModifiedCommand handleNotModifiedCommand = new HandleNotModifiedCommand();
         ResolveContentRewriterCommand resolveContentRewriterCommand = new ResolveContentRewriterCommand();
         AddHeadersToResponseCommand addHeadersToResponseCommand = new AddHeadersToResponseCommand();
         AddCookiesToResponseCommand addCookiesToResponseCommand = new AddCookiesToResponseCommand();
+        HandleRedirectionCommand handleRedirectionCommand = new HandleRedirectionCommand();
+        HandleNotModifiedCommand handleNotModifiedCommand = new HandleNotModifiedCommand();
         SerializeHttpEntityContentCommand serializeHttpEntityContentCommand = new SerializeHttpEntityContentCommand();
 
         processingChain.addCommand(resolveLocalPathCommand);
@@ -135,11 +135,11 @@ public class SimpleReverseProxyServlet e
         processingChain.addCommand(initHttpRequestCommand);
         processingChain.addCommand(addHeaderToHttpRequestCommand);
         processingChain.addCommand(executeHttpClientCommand);
-        processingChain.addCommand(handleRedirectionCommand);
-        processingChain.addCommand(handleNotModifiedCommand);
         processingChain.addCommand(resolveContentRewriterCommand);
         processingChain.addCommand(addHeadersToResponseCommand);
         processingChain.addCommand(addCookiesToResponseCommand);
+        processingChain.addCommand(handleRedirectionCommand);
+        processingChain.addCommand(handleNotModifiedCommand);
         processingChain.addCommand(serializeHttpEntityContentCommand);
 
         return processingChain;