From afbc3aa30cd52f85208db97378a05a530c22fcc9 Mon Sep 17 00:00:00 2001 From: Alejandro Abdelnur Date: Wed, 30 Nov 2011 00:25:54 +0000 Subject: [PATCH] HDFS-2606. webhdfs client filesystem impl must set the content-type header for create/append. (tucu) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1208157 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java | 1 + 2 files changed, 4 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index ed64263971..d78b79c12b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -116,6 +116,9 @@ Trunk (unreleased changes) HDFS-2532. TestDfsOverAvroRpc timing out in trunk (Uma Maheswara Rao G via todd) + HDFS-2606. webhdfs client filesystem impl must set the content-type + header for create/append. (tucu) + Release 0.23.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java index d10e70888e..7b7f20b12d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java @@ -357,6 +357,7 @@ private HttpURLConnection httpConnect(final HttpOpParam.Op op, final Path fspath conn.setRequestMethod(op.getType().toString()); if (op.getDoOutput()) { conn = twoStepWrite(conn, op); + conn.setRequestProperty("Content-Type", "application/octet-stream"); } conn.setDoOutput(op.getDoOutput()); conn.connect();