instaclick/php-webdriver — pull request #60 by c960657 (2014-12-25 19:36:41+00:00)
Title: Always suppress "Expect: 100-continue" header

cURL automatically adds an "Expect: 100-continue" header to all POST/PUT requests larger than 1 KB ([source code](https://github.com/bagder/curl/blob/576ac00eb396dd7fb2d12d0fe4b6fdeeba5071e6/lib/http.c#L2617)). It then waits for up to 1 second for a "100 Continue" response before sending the POST/PUT body ([source code](https://github.com/bagder/curl/blob/56120ca04bc6c0dc4e942504c7abf018b7ef8428/lib/transfer.c#L1973)).

The purpose of this waiting is to give the server a chance to send e.g. a 403 Forbidden, before the client sends a big payload over the wire. This concern is not relevant when talking to a WebDriver server.

The WebDriver implementation embedded in PhantomJS does not support Expect, so my Behat tests spend a lot of time waiting for these 1 second timeouts. Suppressing the Expect header makes them run about 2-3x faster (using PHP 5.3.10).

php-webdriver already suppresses the Expect header in some circumstances (see PR #41). With this PR it is always suppressed.