[ https://issues.apache.org/jira/browse/HDFS-17040?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tsz-wo Sze updated HDFS-17040: ------------------------------ Component/s: ui Description: When uploading a file using -WebHDFS- the Namenode web UI, it will set the content type to application/x-www-form-urlencoded, as this is the default used by jQuery https://github.com/apache/hadoop/blob/160b9fc3c9255024c00d487b7fcdf5ea59a42781/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js#L516 This causes knox to urlencode the request body so that uploading a CVS file 1,2,3 will result 1%2C2%2C3. Instead of application/x-www-form-urlencoded I think the encoding should be set to application/octet-stream. was: When uploading a file WebHDFS will set the content type to application/x-www-form-urlencoded, as this is the default used by jQuery https://github.com/apache/hadoop/blob/160b9fc3c9255024c00d487b7fcdf5ea59a42781/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js#L516 This causes knox to urlencode the request body so that uploading a CVS file 1,2,3 will result 1%2C2%2C3. Instead of application/x-www-form-urlencoded I think the encoding should be set to application/octet-stream. Summary: Namenode UI should set content type to application/octet-stream when uploading a file (was: WebHDFS UI should set content type to application/octet-stream when uploading a file) WebHDFS is a [REST API|https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/WebHDFS.html] which does not have a UI. The [explorer.js|https://github.com/apache/hadoop/blob/160b9fc3c9255024c00d487b7fcdf5ea59a42781/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js#L516] file is from the Namenode web UI, which was designed many years ago to be used by a human with a browser. The Namenode web UI is never a public API. It probably is not following the http standard very strictly. Of course, we should fix this problem. [~amagyar], thanks a lot for filing this JIRA! (Updating the Summary and Description ...) > Namenode UI should set content type to application/octet-stream when > uploading a file > ------------------------------------------------------------------------------------- > > Key: HDFS-17040 > URL: https://issues.apache.org/jira/browse/HDFS-17040 > Project: Hadoop HDFS > Issue Type: Task > Components: ui > Reporter: Attila Magyar > Priority: Major > Labels: pull-request-available > > When uploading a file using -WebHDFS- the Namenode web UI, it will set the > content type to application/x-www-form-urlencoded, as this is the default > used by jQuery > https://github.com/apache/hadoop/blob/160b9fc3c9255024c00d487b7fcdf5ea59a42781/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js#L516 > This causes knox to urlencode the request body so that uploading a CVS file > 1,2,3 will result 1%2C2%2C3. > Instead of application/x-www-form-urlencoded I think the encoding should be > set to application/octet-stream. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org