Skip to content

Commit 8e46be1

Browse files
committed
Merge pull request #60 from c960657/expect-100
Always suppress "Expect: 100-continue" header
2 parents f626e96 + e734ba9 commit 8e46be1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/WebDriver/Service/CurlService.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ public function execute($requestMethod, $url, $parameters = null, $extraOptions
5454
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($parameters));
5555
} else {
5656
$customHeaders[] = 'Content-Length: 0';
57-
$customHeaders[] = 'Expect:';
5857
}
5958

59+
// Suppress "Expect: 100-continue" header automatically added by cURL that
60+
// causes a 1 second delay if the remote server does not support Expect.
61+
$customHeaders[] = 'Expect:';
62+
6063
curl_setopt($curl, CURLOPT_POST, true);
6164
break;
6265

@@ -69,9 +72,12 @@ public function execute($requestMethod, $url, $parameters = null, $extraOptions
6972
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($parameters));
7073
} else {
7174
$customHeaders[] = 'Content-Length: 0';
72-
$customHeaders[] = 'Expect:';
7375
}
7476

77+
// Suppress "Expect: 100-continue" header automatically added by cURL that
78+
// causes a 1 second delay if the remote server does not support Expect.
79+
$customHeaders[] = 'Expect:';
80+
7581
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');
7682
break;
7783
}

0 commit comments

Comments
 (0)