From 7dad21f34c9ca73e78b005aeb76672d6f33453b8 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 31 Oct 2016 00:33:25 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@39044 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/rest-api/class-wp-rest-server.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/rest-api/class-wp-rest-server.php b/src/wp-includes/rest-api/class-wp-rest-server.php index 1b1a24439b..1a43a1ac32 100644 --- a/src/wp-includes/rest-api/class-wp-rest-server.php +++ b/src/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.