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. git-svn-id: https://develop.svn.wordpress.org/trunk@39042 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6413c1efce
commit
67044fe410
|
@ -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' );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue