We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b25d117 commit 2cdbd55Copy full SHA for 2cdbd55
wp-includes/rest-api/auth/class-wp-rest-token.php
@@ -272,10 +272,11 @@ public function require_token() {
272
$require_token = false;
273
}
274
275
- // GET requests do not require authentication, but if a valid token is provided, requests should
+ // GET requests do not require authentication, but if
276
+ // the Authorization header is provided, requests should
277
// be performed as the user corresponding to that token.
- if ( 'GET' === $request_method && is_wp_error( $this->validate_token() ) ) {
278
- $require_token = false;
+ if ( 'GET' === $request_method && ! is_wp_error( $this->get_auth_header() ) ) {
279
+ $require_token = true;
280
281
282
// Don't require authentication to generate a token.
0 commit comments