From 3d2063c8f185c5ecfd79c41f0b98a0891f8a5f36 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 7 Apr 2024 11:16:06 +0000 Subject: [PATCH] HTTP API: Add support for a description for HTTP status code 425 (Too Early). Reference: [https://datatracker.ietf.org/doc/rfc8470/ RFC 8470: Using Early Data in HTTP]. Follow-up to [5446], [6104], [10740], [27422], [36274], [36294], [42207]. Props kkmuffme, mukesh27, joemcgill. Fixes #60942. git-svn-id: https://develop.svn.wordpress.org/trunk@57936 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-http.php | 1 + src/wp-includes/functions.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/wp-includes/class-wp-http.php b/src/wp-includes/class-wp-http.php index 48580680ba..ea8adde0ba 100644 --- a/src/wp-includes/class-wp-http.php +++ b/src/wp-includes/class-wp-http.php @@ -77,6 +77,7 @@ class WP_Http { const UNPROCESSABLE_ENTITY = 422; const LOCKED = 423; const FAILED_DEPENDENCY = 424; + const TOO_EARLY = 425; const UPGRADE_REQUIRED = 426; const PRECONDITION_REQUIRED = 428; const TOO_MANY_REQUESTS = 429; diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 5a5435d33f..ae18925c62 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -1347,6 +1347,7 @@ function wp( $query_vars = '' ) { * @since 3.9.0 Added status codes 418, 428, 429, 431, and 511. * @since 4.5.0 Added status codes 308, 421, and 451. * @since 5.1.0 Added status code 103. + * @since 6.5.0 Added status code 425. * * @global array $wp_header_to_desc * @@ -1408,6 +1409,7 @@ function get_status_header_desc( $code ) { 422 => 'Unprocessable Entity', 423 => 'Locked', 424 => 'Failed Dependency', + 425 => 'Too Early', 426 => 'Upgrade Required', 428 => 'Precondition Required', 429 => 'Too Many Requests',