Skip to content

REST API endpoint for storing a URL Metric should return a 423 Locked status code instead of 403 Forbidden #1860

Description

@westonruter

See todo:

'permission_callback' => static function () {
// Needs to be available to unauthenticated visitors.
if ( OD_Storage_Lock::is_locked() ) {
return new WP_Error(
'url_metric_storage_locked',
__( 'URL Metric storage is presently locked for the current IP.', 'optimization-detective' ),
array( 'status' => 403 ) // TODO: Consider 423 Locked status code.
);
}
return true;
},

Activity

  1. moved this to Not Started/Backlog 📆 in WP Performance Ongoingon Feb 11, 2025
  2. hbhalodia commented on Feb 11, 2025

    @hbhalodia
    Contributor

    Hi @westonruter, I would like to work on this issue and would update the status code for storing URL metric.

    Thank You,

  3. moved this from Not Started/Backlog 📆 to Code Review 👀 in WP Performance Ongoingon Feb 11, 2025
  4. moved this from Code Review 👀 to Done 😃 in WP Performance Ongoingon Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Plugin] Optimization Detective

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions