From dbc4b87b7fac7df56583daf2c8ab8cb5d547c15f Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 31 Oct 2016 00:34:33 +0000 Subject: [PATCH] REST API: Allow Content-Type on CORS requests. This allows `POST` requests with a wider variety of `Content-Type' headers - `Content-Type: application/json`, for example. Props jnylen0. Fixes #37994. Built from https://develop.svn.wordpress.org/trunk@39044 git-svn-id: http://core.svn.wordpress.org/trunk@38986 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rest-api/class-wp-rest-server.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/rest-api/class-wp-rest-server.php b/wp-includes/rest-api/class-wp-rest-server.php index 1b1a24439b..1a43a1ac32 100644 --- a/wp-includes/rest-api/class-wp-rest-server.php +++ b/wp-includes/rest-api/class-wp-rest-server.php @@ -240,7 +240,7 @@ class WP_REST_Server { */ $this->send_header( 'X-Content-Type-Options', 'nosniff' ); $this->send_header( 'Access-Control-Expose-Headers', 'X-WP-Total, X-WP-TotalPages' ); - $this->send_header( 'Access-Control-Allow-Headers', 'Authorization' ); + $this->send_header( 'Access-Control-Allow-Headers', 'Authorization, Content-Type' ); /** * Send nocache headers on authenticated requests. diff --git a/wp-includes/version.php b/wp-includes/version.php index b43468cb91..7e85c37cd9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta1-39043'; +$wp_version = '4.7-beta1-39044'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.