WordPress.org

Make WordPress Core

Changeset 46483


Ignore:
Timestamp:
10/14/2019 04:23:13 PM (5 weeks ago)
Author:
whyisjake
Message:

REST API: Ensure that we don't generate warnings from sending extra headers after headers have been sent.

Fixes issues stemming from [46478].

File:
1 edited

Legend:

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

    r46478 r46483  
    590590        header( 'Access-Control-Allow-Credentials: true' );
    591591        header( 'Vary: Origin' );
    592     } else if ( 'GET' === $_SERVER['REQUEST_METHOD'] && ! is_user_logged_in() ) {
     592    } elseif ( ! headers_sent() && 'GET' === $_SERVER['REQUEST_METHOD'] && ! is_user_logged_in() ) {
    593593        header( 'Vary: Origin' );
    594594    }
Note: See TracChangeset for help on using the changeset viewer.