WordPress.org

Make WordPress Core

Changeset 39044


Ignore:
Timestamp:
10/31/2016 12:33:25 AM (3 years ago)
Author:
pento
Message:

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.

File:
1 edited

Legend:

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

    r39029 r39044  
    241241        $this->send_header( 'X-Content-Type-Options', 'nosniff' );
    242242        $this->send_header( 'Access-Control-Expose-Headers', 'X-WP-Total, X-WP-TotalPages' );
    243         $this->send_header( 'Access-Control-Allow-Headers', 'Authorization' );
     243        $this->send_header( 'Access-Control-Allow-Headers', 'Authorization, Content-Type' );
    244244
    245245        /**
Note: See TracChangeset for help on using the changeset viewer.