From 69539eb2a7d1f393ccb50a1a3461c7da34026b26 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 31 Oct 2016 00:19:30 +0000 Subject: [PATCH] REST API: Add `PATCH` to CORS allowed methods. Editable resources in the REST API accept the `PATCH` method, but the CORS headers don't mention it. Props jnylen0. Fixes #38546. Built from https://develop.svn.wordpress.org/trunk@39042 git-svn-id: http://core.svn.wordpress.org/trunk@38984 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rest-api.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/rest-api.php b/wp-includes/rest-api.php index 7a44856aaf..91b7343f56 100644 --- a/wp-includes/rest-api.php +++ b/wp-includes/rest-api.php @@ -514,7 +514,7 @@ function rest_send_cors_headers( $value ) { if ( $origin ) { header( 'Access-Control-Allow-Origin: ' . esc_url_raw( $origin ) ); - header( 'Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE' ); + header( 'Access-Control-Allow-Methods: OPTIONS, GET, POST, PUT, PATCH, DELETE' ); header( 'Access-Control-Allow-Credentials: true' ); header( 'Vary: Origin' ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index f274cdd9eb..6467463b99 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta1-39041'; +$wp_version = '4.7-beta1-39042'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.