admc/wd — pull request #178 by rvagg (2013-09-19 23:20:33+00:00)
Title: only put body and content-length for POST requests

This one has me a little baffled because it was working fine until recently and I can't figure out which piece of the puzzle has changed. I'm suspecting it might be a Node-core thing, I'm on 0.10.18, I've tried .17 and also 0.11 but nothing older. I don't *think* this is a problem with mikeal/request.

wd -> SauceConnect.jar -> SauceLabs is broken for non-POST requests, if you watch the requests then it appears that SauceConnect isn't responding at all to those requests.

Removing the Content-Length header and `body` from the requests that aren't POST fixes the issue so I my wild guess is that perhaps Node used to write a body for all request types that had a Content-Length but it doesn't any more (which is correct). SauceConnect is probably just being sloppy and seeing that there is a Content-Length it's waiting for a body which never comes.... ***perhaps!***

Anyway, this PR fixes the issue, I don't think wd is using anything other than POST that requires a Content-Length so the `== 'POST'` should be good enough I hope.