-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace the OPTIONS requests with a faster HEAD request in canUser resolver #43703
base: trunk
Are you sure you want to change the base?
Conversation
Size Change: +4 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
The CI run reveals a lot of these errors:
Therefore, a support for HEAD requests would have to be first added to the endpoints before it can be added to |
I can confirm that an |
@adamziel I'd love to get this merged or something like it as it will fix the inability to retrieve Navigation permissions by slug. What do we need to do? Fix the tests? I'm happy to try to do that. |
ef30c45
to
73ed3c1
Compare
I also tested this and using the editor I can see permissions API requests coming back with This might be test specific as suggested by @TimothyBJacobs. A quick search for |
I'm getting
|
Sorry, bit of a brainfart from me. Those endpoints would have a |
While the REST API server does handle |
Thinking about this some more, it seems like we don't have to use Which ever resource method they use, we need permissions requests to:
Is there a way we could patch (or even use a filter for) |
Not entirely related, but I think |
We can check the headers of a 403 response as follows: wp.apiFetch({
path: '/wp/v2/templates',
method: 'HEAD',
parse: false
})
.catch(response => response.headers.get('date'))
.then(console.log) Which means
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
The https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/rest-api.php#L815
Agreed. I don't think this is much of an issue. |
@TimothyBJacobs noted:
This PR is an attempt at just switching the http method to see if the CI checks will pass.
At the moment, this PR is blocked as the HEAD method won't work for all relevant requests, see https://core.trac.wordpress.org/ticket/56481 for more details