{"issue":{"created_at":"2011-11-21T20:47:06Z","state":"open","updated_at":"2011-11-22T04:59:02Z","user":{"gravatar_id":"6e983951e02fc5418a83459791a92890","id":681261,"url":"https://api.github.com/users/sbange","login":"sbange","avatar_url":"https://secure.gravatar.com/avatar/6e983951e02fc5418a83459791a92890?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":2,"body":"XHR post requests issued containing application/x-www-form-urlencoded form data will not send a content-length header. Some servers such as nginx require this or they will respond with status 411.\r\n\r\nMaybe I got the specs wrong but as far as I understand it, content-length should always be send if possible (or forbidden by the rules :-)).\r\n\r\nJust to test this I added 'headers[\"content-length\"] ||= stringify(data).length' after line 178 in 'resources.coffee'. Still stringfy() is called twice in this case and the rules from RFC 2616 4.4 are not considered.\r\n\r\nIs there a reason for this behavior or could we patch this?\r\n","assignee":null,"id":2309168,"labels":[],"number":204,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"Support content-length header for application/x-www-form-urlencoded too","html_url":"https://github.com/assaf/zombie/issues/204","closed_at":null,"url":"https://api.github.com/repos/assaf/zombie/issues/204","milestone":null},"action":"created","comment":{"created_at":"2011-11-22T04:59:02Z","updated_at":"2011-11-22T04:59:02Z","user":{"gravatar_id":"a62b87a36bfc29a7207bc73f3aac960b","id":5158,"url":"https://api.github.com/users/assaf","login":"assaf","avatar_url":"https://secure.gravatar.com/avatar/a62b87a36bfc29a7207bc73f3aac960b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Think I broke it in a recent update, to support sending binary data.\nCan certainly be added back just for URL-encoded requests. Ideally\nwith a test case so it doesn't break again. Want to take a shot at it?\n\nOn Nov 21, 2011, at 12:47 PM, Sven Bange\n<reply@reply.github.com>\nwrote:\n\n> XHR post requests issued containing application/x-www-form-urlencoded form data will not send a content-length header. Some servers such as nginx require this or they will respond with status 411.\n>\n> Maybe I got the specs wrong but as far as I understand it, content-length should always be send if possible (or forbidden by the rules :-)).\n>\n> Just to test this I added 'headers[\"content-length\"] ||= stringify(data).length' after line 178 in 'resources.coffee'. Still stringfy() is called twice in this case and the rules from RFC 2616 4.4 are not considered.\n>\n> Is there a reason for this behavior or could we patch this?\n>\n> ---\n> Reply to this email directly or view it on GitHub:\n> https://github.com/assaf/zombie/issues/204","id":2830453,"url":"https://api.github.com/repos/assaf/zombie/issues/comments/2830453"}}