From 7bf2f9559f884827f2ea09412e4c20a456e972df Mon Sep 17 00:00:00 2001 From: Arun Murthy Date: Wed, 29 Feb 2012 22:14:32 +0000 Subject: [PATCH] MAPREDUCE-3706. Fix circular redirect error in job-attempts page. Contributed by Robert Evans. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1295314 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../hadoop/yarn/server/webproxy/WebAppProxyServlet.java | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 6b286ea24c..9535449de5 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -226,6 +226,9 @@ Release 0.23.2 - UNRELEASED MAPREDUCE-3903. Add support for mapreduce admin users. (Thomas Graves via sseth) + MAPREDUCE-3706. Fix circular redirect error in job-attempts page. (bobby + via acmurthy) + Release 0.23.1 - 2012-02-17 INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java index 3cca8bfb2c..d5b99583c8 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java @@ -38,7 +38,9 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.httpclient.Header; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpMethod; +import org.apache.commons.httpclient.cookie.CookiePolicy; import org.apache.commons.httpclient.methods.GetMethod; +import org.apache.commons.httpclient.params.HttpClientParams; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.io.IOUtils; @@ -124,7 +126,10 @@ public class WebAppProxyServlet extends HttpServlet { HttpServletResponse resp, URI link,Cookie c) throws IOException { org.apache.commons.httpclient.URI uri = new org.apache.commons.httpclient.URI(link.toString(), false); - HttpClient client = new HttpClient(); + HttpClientParams params = new HttpClientParams(); + params.setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY); + params.setBooleanParameter(HttpClientParams.ALLOW_CIRCULAR_REDIRECTS, true); + HttpClient client = new HttpClient(params); HttpMethod method = new GetMethod(uri.getEscapedURI()); @SuppressWarnings("unchecked")