[wp-trac] [WordPress Trac] #43691: class-wp-rest-server sends response body regardless of actual response code or result type

WordPress Trac noreply at wordpress.org
Tue Jun 18 18:27:30 UTC 2019


#43691: class-wp-rest-server sends response body regardless of actual response code
or result type
----------------------------+--------------------------------
 Reporter:  matthias.thiel  |       Owner:  TimothyBlynJacobs
     Type:  defect (bug)    |      Status:  assigned
 Priority:  normal          |   Milestone:  5.3
Component:  REST API        |     Version:  4.7
 Severity:  normal          |  Resolution:
 Keywords:  needs-patch     |     Focuses:  rest-api
----------------------------+--------------------------------
Changes (by TimothyBlynJacobs):

 * keywords:   => needs-patch
 * owner:  (none) => TimothyBlynJacobs
 * version:   => 4.7
 * status:  new => assigned
 * milestone:  Awaiting Review => 5.3


Comment:

 There is a related Gutenberg ticket,
 https://github.com/WordPress/gutenberg/pull/11208

 Handling `null` is probably the safest way to go. It is hard to see a
 reason why someone would expect the `string` `"null"` to appear in the
 response body when using the `null` type in PHP and as such is least
 likely to cause a BC break.

 We could also consider adding a `_doing_it_wrong` if a response body is
 sent with a `204` response code.

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


More information about the wp-trac mailing list