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 ca76a9c commit d4545b5Copy full SHA for d4545b5
wp-includes/rest-api/auth/class-wp-rest-token.php
@@ -380,9 +380,15 @@ public function require_token() {
380
$require_token = false;
381
}
382
383
+ // Don't require a token or Authorization header for preflight OPTIONS
384
+ // requests.
385
+ if ( 'OPTIONS' === $request_method ) {
386
+ $require_token = false;
387
+ }
388
+
389
/**
390
* GET requests do not typically require authentication, but if the
- * Authorization header is provided, we will use it. WHat's happening
391
+ * Authorization header is provided, we will use it. What's happening
392
* here is that `WP_REST_Token::get_auth_header` returns the bearer
393
* token or a `WP_Error`. So if we have an error then we can safely skip
394
* the GET request.
0 commit comments