mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-02-16 13:52:51 +00:00
REST API: Ensure that we don't generate warnings from sending extra headers after headers have been sent.
Fixes issues stemming from [46478]. git-svn-id: https://develop.svn.wordpress.org/trunk@46483 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2a5c167b21
commit
4e2d91d186
@ -589,7 +589,7 @@ function rest_send_cors_headers( $value ) {
|
||||
header( 'Access-Control-Allow-Methods: OPTIONS, GET, POST, PUT, PATCH, DELETE' );
|
||||
header( 'Access-Control-Allow-Credentials: true' );
|
||||
header( 'Vary: Origin' );
|
||||
} else if ( 'GET' === $_SERVER['REQUEST_METHOD'] && ! is_user_logged_in() ) {
|
||||
} elseif ( ! headers_sent() && 'GET' === $_SERVER['REQUEST_METHOD'] && ! is_user_logged_in() ) {
|
||||
header( 'Vary: Origin' );
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user