Skip to content

Commit d4447c0

Browse files
committed
Bootstrap/Load: Add HTTP/3 as a valid HTTP protocol.
As of November 2021, the `HTTP/3` protocol is still officially an Internet Draft, but is already supported by 74% of running web browsers and, according to W3Techs, 23% of the top 10 million websites. It has been supported by Google Chrome (including Chrome for Android, and Microsoft Edge, which is based on it) since April 2020 and by Mozilla Firefox since May 2021. Safari 14 (on macOS Big Sur and iOS 14) has also implemented the protocol but support is hidden behind a feature flag. Based on the wide support, this change adds `HTTP/3` as a valid HTTP protocol. Props malthert. Fixes #54404. git-svn-id: https://develop.svn.wordpress.org/trunk@52087 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 6981c47 commit d4447c0

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/wp-admin/load-scripts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
define( 'WPINC', 'wp-includes' );
1616

1717
$protocol = $_SERVER['SERVER_PROTOCOL'];
18-
if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ), true ) ) {
18+
if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0', 'HTTP/3' ), true ) ) {
1919
$protocol = 'HTTP/1.0';
2020
}
2121

src/wp-admin/load-styles.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
require ABSPATH . WPINC . '/version.php';
2424

2525
$protocol = $_SERVER['SERVER_PROTOCOL'];
26-
if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ), true ) ) {
26+
if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0', 'HTTP/3' ), true ) ) {
2727
$protocol = 'HTTP/1.0';
2828
}
2929

src/wp-comments-post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
if ( 'POST' !== $_SERVER['REQUEST_METHOD'] ) {
99
$protocol = $_SERVER['SERVER_PROTOCOL'];
10-
if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ), true ) ) {
10+
if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0', 'HTTP/3' ), true ) ) {
1111
$protocol = 'HTTP/1.0';
1212
}
1313

src/wp-includes/load.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
function wp_get_server_protocol() {
1616
$protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : '';
17-
if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ), true ) ) {
17+
if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0', 'HTTP/3' ), true ) ) {
1818
$protocol = 'HTTP/1.0';
1919
}
2020
return $protocol;

0 commit comments

Comments
 (0)