[
https://issues.apache.org/jira/browse/HDFS-11222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15756199#comment-15756199
]
Yiqun Lin edited comment on HDFS-11222 at 12/17/16 4:12 AM:
------------------------------------------------------------
Thanks [~jojochuang] for the review and comments.
{quote}
The content type check seems only performed when I added extra parameters
data=true ?
{quote}
I think this is not absolutely right. I debugged the test in my local and found
something interesting. In httpfs, if we don't add parameter {{&data=true}}, the
data stream of uploading file and the relevant attribute parameters
(replication, blocksize, etc.) will be ignored. Instead of, it will create a
new url in {{HttpFSServer#createUploadRedirectionURL}} with adding
{{&data=true}} parameter added then redirect to the new url. Since in new url
the {{data}} was added, it will do the content type check as well . I just test
this in the unit tests, correct me if I am wrong thanks.
was (Author: linyiqun):
Thanks [~jojochuang] for the review and comments.
{quote}
The content type check seems only performed when I added extra parameters
data=true ?
{quote}
I'm absolutely confirm this is right. I debugged the test in my local and found
something interesting. In httpfs, if we don't add parameter {{&data=true}}, the
data stream of uploading file and the relevant attribute parameters
(replication, blocksize, etc.) will be ignored. Instead of, it will create a
new url in {{HttpFSServer#createUploadRedirectionURL}} with {{&data=true}}
parameter added. So the content type checking only happens in data upload
request with sending file data.
> Document application/octet-stream as required content type for data upload
> requests in HTTPFS
> ---------------------------------------------------------------------------------------------
>
> Key: HDFS-11222
> URL: https://issues.apache.org/jira/browse/HDFS-11222
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: documentation, httpfs
> Affects Versions: 3.0.0-alpha2
> Reporter: Sailesh Patel
> Assignee: Yiqun Lin
> Priority: Minor
> Attachments: HDFS-11222.001.patch, HDFS-11222.002.patch
>
>
> Documentation at [1] should indicate the PUT and POST requires a command
> like ( --header ):
> curl -i -X PUT -T <LOCAL_FILE>
> "http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=CREATE..." --header
> "content-type: application/octet-stream"
> [1]
> https://hadoop.apache.org/docs/stable2/hadoop-project-dist/hadoop-hdfs/WebHDFS.html#Create_and_Write_to_a_File
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]