REST API: Allow for multiple Vary: Origin headers in GET responses.
Simple fix, we pass `false` as the second parameter to the header function. This is something that we added downstream of the 5.2.4 release, but we missed in 5.2/trunk. Fixes #48309. Props xknown, whyisjake. Built from https://develop.svn.wordpress.org/trunk@46544 git-svn-id: http://core.svn.wordpress.org/trunk@46341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
aca0d9968f
commit
6c3a387d77
|
@ -588,9 +588,9 @@ function rest_send_cors_headers( $value ) {
|
||||||
header( 'Access-Control-Allow-Origin: ' . $origin );
|
header( 'Access-Control-Allow-Origin: ' . $origin );
|
||||||
header( 'Access-Control-Allow-Methods: OPTIONS, GET, POST, PUT, PATCH, DELETE' );
|
header( 'Access-Control-Allow-Methods: OPTIONS, GET, POST, PUT, PATCH, DELETE' );
|
||||||
header( 'Access-Control-Allow-Credentials: true' );
|
header( 'Access-Control-Allow-Credentials: true' );
|
||||||
header( 'Vary: Origin' );
|
header( 'Vary: Origin', false );
|
||||||
} elseif ( ! headers_sent() && 'GET' === $_SERVER['REQUEST_METHOD'] && ! is_user_logged_in() ) {
|
} elseif ( ! headers_sent() && 'GET' === $_SERVER['REQUEST_METHOD'] && ! is_user_logged_in() ) {
|
||||||
header( 'Vary: Origin' );
|
header( 'Vary: Origin', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.3-beta3-46543';
|
$wp_version = '5.3-beta3-46544';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue