Introduce wp_get_server_protocol() to DRY protocol parsing logic and make adding more protocols, like HTTP/2, easier.

Props johnbillion, wonderboymusic.
Fixes #34131.


git-svn-id: https://develop.svn.wordpress.org/trunk@34894 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2015-10-07 02:34:58 +00:00
parent dae3ea83cb
commit aac08d7735
2 changed files with 19 additions and 14 deletions
+1 -3
View File
@@ -992,9 +992,7 @@ function status_header( $code ) {
if ( empty( $description ) )
return;
$protocol = $_SERVER['SERVER_PROTOCOL'];
if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol )
$protocol = 'HTTP/1.0';
$protocol = wp_get_server_protocol();
$status_header = "$protocol $code $description";
if ( function_exists( 'apply_filters' ) )