-
-
Save soderlind/9c7f6d3820552d496ed56656d7537f05 to your computer and use it in GitHub Desktop.
Revisions
-
carlalexander revised this gist
Mar 10, 2021 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,8 +5,10 @@ * performance. Instead, we'll send it if the body is larger than 1 mb like * Guzzle does. */ function add_expect_header(array $arguments) { $arguments['headers']['expect'] = !empty($arguments['body']) && strlen($arguments['body']) > 1048576 ? '100-Continue' : ''; return $arguments; } add_filter('http_request_args', 'add_expect_header'); -
carlalexander created this gist
Mar 10, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ <?php /** * By default, cURL sends the "Expect" header all the time which severely impacts * performance. Instead, we'll send it if the body is larger than 1 mb like * Guzzle does. */ function add_expect_header($arguments) { $arguments['headers']['expect'] = !empty($arguments['body']) && strlen($arguments['body']) > 1048576 ? '100-Continue' : ''; } add_filter('http_request_args', 'add_expect_header');