[ https://issues.apache.org/jira/browse/HDFS-6217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13978866#comment-13978866 ]
Daryn Sharp commented on HDFS-6217: ----------------------------------- The value of {{setDoOutput}} has no bearing on whether a content length or chunked encoding header is sent. The only reliable method I found was translate {{setDoOutput(false)}} into {{setDoOutput(true)}} followed by immediate open/close of the output stream. Streamlining the code to remove the POST/PUT conditional would force a Content-Length on say a GET request. The RFC is ambiguous about whether a message payload is allowed on non-POST/PUT ops, so I wouldn't be surprised if proxies and/or jetty mishandle it. > Webhdfs PUT operations may not work via a http proxy > ---------------------------------------------------- > > Key: HDFS-6217 > URL: https://issues.apache.org/jira/browse/HDFS-6217 > Project: Hadoop HDFS > Issue Type: Sub-task > Components: webhdfs > Affects Versions: 2.0.0-alpha, 3.0.0 > Reporter: Daryn Sharp > Assignee: Daryn Sharp > Attachments: HDFS-6217.patch > > > Most of webhdfs's PUT operations have no message body. The HTTP/1.1 spec is > fuzzy in how PUT requests with no body should be handled. If the request > does not specify chunking or Content-Length, the server _may_ consider the > request to have no body. However, popular proxies such as Apache Traffic > Server will reject PUT requests with no body unless Content-Length: 0 is > specified. -- This message was sent by Atlassian JIRA (v6.2#6252)