mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 07:22:01 +01:00
REST API: Include Vary: Origin
in cors headers
`vary: origin` is a W3 CORS implementation recommendation( https://www.w3.org/TR/cors/#resource-implementation ). It's used by default in frameworks such as hapi and Laravel-cors. Overall, it helps sites siting behind a cache such as varnish. Fixes #38060. Props procodewp, pdufour for research. Built from https://develop.svn.wordpress.org/trunk@38806 git-svn-id: http://core.svn.wordpress.org/trunk@38749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1e54943b0f
commit
969e4255a9
@ -408,6 +408,7 @@ function rest_send_cors_headers( $value ) {
|
||||
header( 'Access-Control-Allow-Origin: ' . esc_url_raw( $origin ) );
|
||||
header( 'Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE' );
|
||||
header( 'Access-Control-Allow-Credentials: true' );
|
||||
header( 'Vary: Origin' );
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.7-alpha-38805';
|
||||
$wp_version = '4.7-alpha-38806';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user