WordPress.org

Make WordPress Core

Opened 15 months ago

Last modified 15 months ago

#39889 new defect (bug)

Improve/Fix REST Response on Multisite when an endpoint for a non-existent site is hit.

Reported by: nerrad Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.7
Component: REST API Keywords: needs-patch needs-unit-tests
Focuses: multisite, rest-api Cc:

Description

Currently if you hit the endpoint for a domain on a site that doesn't exist it will behave the same as on a normal request.

Granted this is kind of edgecase, but I think it'd be better to handle things a bit better on REST requests. The question is how? I think from the standpoint of the REST client it'd be better to just return a 404 and a "site doesnt' exist" message (or something to that affect).

Change History (1)

#1 @jnylen0
15 months ago

  • Keywords needs-patch needs-unit-tests added
  • Milestone changed from Awaiting Review to Future Release

I am +1 on fixing this - the REST API should return a JSON 404 in the same style as the rest of our WP_Error responses.

The question is how. May be tricky depending on how early the current 404 is returned.

Note: See TracTickets for help on using tickets.