X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/607b7e02d77e7326161e8ec15639052d2040f745..e3ff8f35458a959c1879c0a4976701ed8dcfe651:/wp-comments-post.php diff --git a/wp-comments-post.php b/wp-comments-post.php index 4e9f1fcf..2c421d32 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; }