{"action":"created","issue":{"url":"https://api.github.com/repos/chef/chef/issues/4646","repository_url":"https://api.github.com/repos/chef/chef","labels_url":"https://api.github.com/repos/chef/chef/issues/4646/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef/issues/4646/comments","events_url":"https://api.github.com/repos/chef/chef/issues/4646/events","html_url":"https://github.com/chef/chef/pull/4646","id":137413566,"number":4646,"title":"Handle negative content length headers too.","user":{"login":"coderanger","id":128243,"avatar_url":"https://avatars.githubusercontent.com/u/128243?v=3","gravatar_id":"","url":"https://api.github.com/users/coderanger","html_url":"https://github.com/coderanger","followers_url":"https://api.github.com/users/coderanger/followers","following_url":"https://api.github.com/users/coderanger/following{/other_user}","gists_url":"https://api.github.com/users/coderanger/gists{/gist_id}","starred_url":"https://api.github.com/users/coderanger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coderanger/subscriptions","organizations_url":"https://api.github.com/users/coderanger/orgs","repos_url":"https://api.github.com/users/coderanger/repos","events_url":"https://api.github.com/users/coderanger/events{/privacy}","received_events_url":"https://api.github.com/users/coderanger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-29T23:32:16Z","updated_at":"2016-03-01T18:32:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/chef/chef/pulls/4646","html_url":"https://github.com/chef/chef/pull/4646","diff_url":"https://github.com/chef/chef/pull/4646.diff","patch_url":"https://github.com/chef/chef/pull/4646.patch"},"body":"This is equivalent to not passing one, we can't check for bad downloads.\r\n\r\nFor an example, run `curl -ivs -o /dev/null \"https://www.isc.org/downloads/file/dhcp-4-3-3-p1/?version=tar-gz\"`\r\n\r\nCurl displays `Negative content-length: -1, closing after transfer`. I can't find any standard for this behavior, but it seems to be shared by all the browsers I tried. ¯\\_(ツ)_/¯"},"comment":{"url":"https://api.github.com/repos/chef/chef/issues/comments/190844081","html_url":"https://github.com/chef/chef/pull/4646#issuecomment-190844081","issue_url":"https://api.github.com/repos/chef/chef/issues/4646","id":190844081,"user":{"login":"mrvinti","id":4896030,"avatar_url":"https://avatars.githubusercontent.com/u/4896030?v=3","gravatar_id":"","url":"https://api.github.com/users/mrvinti","html_url":"https://github.com/mrvinti","followers_url":"https://api.github.com/users/mrvinti/followers","following_url":"https://api.github.com/users/mrvinti/following{/other_user}","gists_url":"https://api.github.com/users/mrvinti/gists{/gist_id}","starred_url":"https://api.github.com/users/mrvinti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrvinti/subscriptions","organizations_url":"https://api.github.com/users/mrvinti/orgs","repos_url":"https://api.github.com/users/mrvinti/repos","events_url":"https://api.github.com/users/mrvinti/events{/privacy}","received_events_url":"https://api.github.com/users/mrvinti/received_events","type":"User","site_admin":false},"created_at":"2016-03-01T18:32:17Z","updated_at":"2016-03-01T18:32:17Z","body":"@coderanger thanks for fast PR!\r\n\r\nThis is the exception raised during convergence.\r\n\r\nHowever *I believe* Net::HTTP yields the 1st byte only in this case and not reading all the bytes from the socket.\r\n\r\n    * remote_file[/var/chef/cache/dhcp-4-3-3-p1.tar.gz] action create\r\n\r\n    =========================================================================\r\n    Error executing action `create` on resource 'remote_file[/var/chef/cache/dhcp-4-3-3-p1.tar.gz]'\r\n    =========================================================================\r\n    \r\n    Chef::Exceptions::ContentLengthMismatch\r\n    ---------------------------------------\r\n    Response body length 1 does not match HTTP Content-Length header -1.\r\n    This error is most often caused by network issues (proxies, etc) outside of chef-client.\r\n\r\n"}}