[wp-trac] [WordPress Trac] #54807: URL Details request returns a 404 status for inaccessible pages

WordPress Trac noreply at wordpress.org
Thu Feb 3 02:34:55 UTC 2022


#54807: URL Details request returns a 404 status for inaccessible pages
--------------------------+-----------------------
 Reporter:  talldanwp     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.9.1
Component:  REST API      |     Version:  5.9
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:  rest-api
--------------------------+-----------------------

Comment (by peterwilsoncc):

 I compared this with the oembed proxy endpoint in `WP_oEmbed_Controller`
 introduced in WordPress 4.8.0. It too returns a 404 when attempting to
 access a resource that doesn't exist.

 Testing steps:

 1. Open your browsers developer tools to the network tab
 1. Edit a new page or post
 1. Attempt to embed the non-existent URL
 https://twitter.com/wordpress/status/40454807
 1. In developer tools, observe the request to http://wp-dev.local/wp-
 json/oembed/1.0/proxy?url=https%3A%2F%2Ftwitter.com%2Fwordpress%2Fstatus%2F40454807&_locale=user
 returns a `404 File not found` response.

 Testing with https://httpstat.us/500 (which returns a `500 Internal Server
 Error`) also returns a 404 response on both the oembed proxy and URL
 details endpoint.

 I think @talldanwp is correct that a `200 OK` is a more accurate response
 because the REST API URLs are working as intended but I would prefer the
 two endpoints provide a consistent behavior.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54807#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list