mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
HTTP API: Fix request header inconsistencies.
This changeset improves the consistency in capitalization of fetching and outputting of request headers. It also updates occurrences found in some docblocks. Props johnjamesjacoby, costdev, audrasjb, petitphp, mhkuu, SergeyBiryukov. Fixes #54225. git-svn-id: https://develop.svn.wordpress.org/trunk@55210 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -291,16 +291,16 @@ class WP_REST_Request implements ArrayAccess {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the content-type of the request.
|
||||
* Retrieves the Content-Type of the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
*
|
||||
* @return array|null Map containing 'value' and 'parameters' keys
|
||||
* or null when no valid content-type header was
|
||||
* or null when no valid Content-Type header was
|
||||
* available.
|
||||
*/
|
||||
public function get_content_type() {
|
||||
$value = $this->get_header( 'content-type' );
|
||||
$value = $this->get_header( 'Content-Type' );
|
||||
if ( empty( $value ) ) {
|
||||
return null;
|
||||
}
|
||||
@@ -325,11 +325,11 @@ class WP_REST_Request implements ArrayAccess {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the request has specified a JSON content-type.
|
||||
* Checks if the request has specified a JSON Content-Type.
|
||||
*
|
||||
* @since 5.6.0
|
||||
*
|
||||
* @return bool True if the content-type header is JSON.
|
||||
* @return bool True if the Content-Type header is JSON.
|
||||
*/
|
||||
public function is_json_content_type() {
|
||||
$content_type = $this->get_content_type();
|
||||
@@ -719,7 +719,7 @@ class WP_REST_Request implements ArrayAccess {
|
||||
$this->parsed_body = true;
|
||||
|
||||
/*
|
||||
* Check that we got URL-encoded. Treat a missing content-type as
|
||||
* Check that we got URL-encoded. Treat a missing Content-Type as
|
||||
* URL-encoded for maximum compatibility.
|
||||
*/
|
||||
$content_type = $this->get_content_type();
|
||||
|
||||
Reference in New Issue
Block a user