mirror of
git://develop.git.wordpress.org/
synced 2025-01-18 05:18:42 +01: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:
parent
f53a78fda7
commit
2a5c167b21
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user