diff --git a/wp-comments-post.php b/wp-comments-post.php index 4e9f1fcfb0e0..2c421d327ade 100644 --- a/wp-comments-post.php +++ b/wp-comments-post.php @@ -6,8 +6,13 @@ */ if ( 'POST' != $_SERVER['REQUEST_METHOD'] ) { + $protocol = $_SERVER['SERVER_PROTOCOL']; + if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ) ) ) { + $protocol = 'HTTP/1.0'; + } + header('Allow: POST'); - header('HTTP/1.1 405 Method Not Allowed'); + header("$protocol 405 Method Not Allowed"); header('Content-Type: text/plain'); exit; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 8c0f96cf54e4..bd5a8ac3dac3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38431'; +$wp_version = '4.7-alpha-38432'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.