mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-05-20 11:14:28 +00:00
REST API: Send a Vary: Origin header on GET requests.
Add this header on all GET requests to prevent cached requests. Props darthhexx, davidbinda, nickdaugherty, whyisjake. git-svn-id: https://develop.svn.wordpress.org/trunk@46478 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -589,6 +589,8 @@ 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() ) {
|
||||
header( 'Vary: Origin' );
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
||||
Reference in New Issue
Block a user