diff --git a/wp-includes/class-IXR.php b/wp-includes/class-IXR.php index 91b65e96bf..5930f562e4 100644 --- a/wp-includes/class-IXR.php +++ b/wp-includes/class-IXR.php @@ -402,7 +402,11 @@ class IXR_Server { if (!$data) { if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] !== 'POST') { - header('Content-Type: text/plain'); // merged from WP #9093 + if ( function_exists( 'status_header' ) ) { + status_header( 405 ); // WP #20986 + header( 'Allow: POST' ); + } + header('Content-Type: text/plain'); // merged from WP #9093 die('XML-RPC server accepts POST requests only.'); }