REST API: Ensure no-cache headers are sent when methods are ovverriden.
Props tykoted, xknown, ehtis, timothyblynjacobs, peterwilsoncc, rmccue, jorbin. Built from https://develop.svn.wordpress.org/trunk@56834 git-svn-id: http://core.svn.wordpress.org/trunk@56346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -1090,6 +1090,7 @@ function rest_cookie_check_errors( $result ) {
|
||||
$result = wp_verify_nonce( $nonce, 'wp_rest' );
|
||||
|
||||
if ( ! $result ) {
|
||||
add_filter( 'rest_send_nocache_headers', '__return_true', 20 );
|
||||
return new WP_Error( 'rest_cookie_invalid_nonce', __( 'Cookie check failed' ), array( 'status' => 403 ) );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user