[wp-trac] [WordPress Trac] #53056: REST API json_encode error returns 500 data->status in body(Correct) but 200 in actual status(Incorrect).

WordPress Trac noreply at wordpress.org
Mon Apr 26 18:25:28 UTC 2021


#53056: REST API json_encode error returns 500 data->status in body(Correct) but
200 in actual status(Incorrect).
-------------------------------------------------+-------------------------
 Reporter:  lalitjalandhar                       |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  5.8
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  needs-patch good-first-bug needs-    |     Focuses:  rest-api
  unit-tests                                     |
-------------------------------------------------+-------------------------
Changes (by desrosj):

 * keywords:   => needs-patch good-first-bug needs-unit-tests
 * focuses:   => rest-api
 * milestone:  Awaiting Review => 5.8


Comment:

 Thanks for this one, @lalitjalandhar. And welcome to Trac!

 It seems that there is a missing `set_status()` call here. Would you be
 interested in creating a patch?

 It would also be nice to add a few tests to confirm the desired behavior
 after these changes.

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


More information about the wp-trac mailing list