private function normalizeRequestHeaders(array $headers)
    {
        // Explicitly set an empty Expect header, so that the server will not
        // respond with a "100 Continue" status code for large uploads.
        $emptyExpectHeader = 'Expect: ';
        $haveExpectHeader = false;

        for ($i = 0; $i < count($headers); $i++) {
            if ($this->isExpectHeader($headers[$i])) {
                // There is already an expect header - let's set it to empty
                $headers[$i] = $emptyExpectHeader;
                $haveExpectHeader = true;
                break;
            }
        }

        if (!$haveExpectHeader) {
            // There is no expect header - let's add one
            $headers[] = $emptyExpectHeader;
        }

        return $headers;
    }