You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by sz...@apache.org on 2011/10/13 22:48:45 UTC
svn commit: r1183086 - in /hadoop/common/branches/branch-0.20-security: ./
src/hdfs/org/apache/hadoop/hdfs/server/datanode/web/resources/
src/hdfs/org/apache/hadoop/hdfs/server/namenode/web/resources/
Author: szetszwo
Date: Thu Oct 13 20:48:45 2011
New Revision: 1183086
URL: http://svn.apache.org/viewvc?rev=1183086&view=rev
Log:
HDFS-2441. Remove the Content-Type set by HttpServer.QuotingInputFilter in webhdfs responses.
Modified:
hadoop/common/branches/branch-0.20-security/CHANGES.txt
hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/web/resources/DatanodeWebHdfsMethods.java
hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/namenode/web/resources/NamenodeWebHdfsMethods.java
Modified: hadoop/common/branches/branch-0.20-security/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/CHANGES.txt?rev=1183086&r1=1183085&r2=1183086&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20-security/CHANGES.txt Thu Oct 13 20:48:45 2011
@@ -319,6 +319,9 @@ Release 0.20.205.0 - unreleased
HDFS-2411. With webhdfs enabled in secure mode the auth to local mappings
are not being respected. (jitendra)
+ HDFS-2441. Remove the Content-Type set by HttpServer.QuotingInputFilter in
+ webhdfs responses. (szetszwo)
+
IMPROVEMENTS
MAPREDUCE-2928. MR-2413 improvements (Eli Collins via mattf)
Modified: hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/web/resources/DatanodeWebHdfsMethods.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/web/resources/DatanodeWebHdfsMethods.java?rev=1183086&r1=1183085&r2=1183086&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/web/resources/DatanodeWebHdfsMethods.java (original)
+++ hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/web/resources/DatanodeWebHdfsMethods.java Thu Oct 13 20:48:45 2011
@@ -26,6 +26,7 @@ import java.net.URISyntaxException;
import java.security.PrivilegedExceptionAction;
import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.Consumes;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
@@ -76,6 +77,7 @@ public class DatanodeWebHdfsMethods {
public static final Log LOG = LogFactory.getLog(DatanodeWebHdfsMethods.class);
private @Context ServletContext context;
+ private @Context HttpServletResponse response;
/** Handle HTTP PUT request. */
@PUT
@@ -106,6 +108,9 @@ public class DatanodeWebHdfsMethods {
replication, blockSize));
}
+ //clear content type
+ response.setContentType(null);
+
return ugi.doAs(new PrivilegedExceptionAction<Response>() {
@Override
public Response run() throws IOException, URISyntaxException {
@@ -158,6 +163,9 @@ public class DatanodeWebHdfsMethods {
+ Param.toSortedString(", ", bufferSize));
}
+ //clear content type
+ response.setContentType(null);
+
return ugi.doAs(new PrivilegedExceptionAction<Response>() {
@Override
public Response run() throws IOException {
@@ -208,6 +216,9 @@ public class DatanodeWebHdfsMethods {
+ Param.toSortedString(", ", offset, length, bufferSize));
}
+ //clear content type
+ response.setContentType(null);
+
return ugi.doAs(new PrivilegedExceptionAction<Response>() {
@Override
public Response run() throws IOException {
Modified: hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/namenode/web/resources/NamenodeWebHdfsMethods.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/namenode/web/resources/NamenodeWebHdfsMethods.java?rev=1183086&r1=1183085&r2=1183086&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/namenode/web/resources/NamenodeWebHdfsMethods.java (original)
+++ hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/namenode/web/resources/NamenodeWebHdfsMethods.java Thu Oct 13 20:48:45 2011
@@ -27,6 +27,7 @@ import java.security.PrivilegedException
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
@@ -102,6 +103,7 @@ public class NamenodeWebHdfsMethods {
private @Context ServletContext context;
private @Context HttpServletRequest request;
+ private @Context HttpServletResponse response;
private static DatanodeInfo chooseDatanode(final NameNode namenode,
final String path, final HttpOpParam.Op op, final long openOffset
@@ -215,6 +217,9 @@ public class NamenodeWebHdfsMethods {
modificationTime, accessTime));
}
+ //clear content type
+ response.setContentType(null);
+
return ugi.doAs(new PrivilegedExceptionAction<Response>() {
@Override
public Response run() throws IOException, URISyntaxException {
@@ -312,6 +317,9 @@ public class NamenodeWebHdfsMethods {
+ Param.toSortedString(", ", bufferSize));
}
+ //clear content type
+ response.setContentType(null);
+
return ugi.doAs(new PrivilegedExceptionAction<Response>() {
@Override
public Response run() throws IOException, URISyntaxException {
@@ -389,6 +397,8 @@ public class NamenodeWebHdfsMethods {
+ Param.toSortedString(", ", offset, length, renewer, bufferSize));
}
+ //clear content type
+ response.setContentType(null);
return ugi.doAs(new PrivilegedExceptionAction<Response>() {
@Override
@@ -516,6 +526,9 @@ public class NamenodeWebHdfsMethods {
+ Param.toSortedString(", ", recursive));
}
+ //clear content type
+ response.setContentType(null);
+
return ugi.doAs(new PrivilegedExceptionAction<Response>() {
@Override
public Response run() throws IOException {