Opened 9 years ago
Last modified 7 years 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: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | REST API | Version: | 4.7 |
| Severity: | normal | Keywords: | needs-patch needs-unit-tests |
| Cc: | Focuses: | multisite, rest-api |
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.
- visit https://nonexistentsubdomain.eventsmart.com/wp-json in a REST client.
- Take note of the "Location" header in the response: https://eventsmart.com/wp-signup.php?new=nonexistentsite. It's also returned with a HTTP 302
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 (3)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I am +1 on fixing this - the REST API should return a JSON 404 in the same style as the rest of our
WP_Errorresponses.The question is how. May be tricky depending on how early the current 404 is returned.