Skip to content

Instantly share code, notes, and snippets.

@JRGould
Last active September 6, 2016 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JRGould/bd4e23a40111f5f3cd69b6913e05de00 to your computer and use it in GitHub Desktop.
Save JRGould/bd4e23a40111f5f3cd69b6913e05de00 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: WPMDB - Fix cURL Expect Header
Plugin URI: https://gist.github.com/JRGould/bd4e23a40111f5f3cd69b6913e05de00/
Description: Preempts automatic inclusion of "Expect: 100-continue" header by cURL which can cause null response from remote site, resulting in "cURL Error 52: Empty reply from server."
Author: Delicious Brains
Author URI: http://deliciousbrains.com
Version: 0.1
Network: True
*/
function dbrains_preempt_expect_header($r, $url) {
$r['headers']['Expect'] = '';
return $r;
}
add_filter( 'http_request_args', 'dbrains_preempt_expect_header', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment