WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/31/2016 12:18:14 AM (4 years ago)
Author:
pento
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api.php

    r39037 r39042  
    515515    if ( $origin ) {
    516516        header( 'Access-Control-Allow-Origin: ' . esc_url_raw( $origin ) );
    517         header( 'Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE' );
     517        header( 'Access-Control-Allow-Methods: OPTIONS, GET, POST, PUT, PATCH, DELETE' );
    518518        header( 'Access-Control-Allow-Credentials: true' );
    519519        header( 'Vary: Origin' );
Note: See TracChangeset for help on using the changeset viewer.