[wp-trac] [WordPress Trac] #49404: WP_REST_Request->parse_json_params only supports 'application/json'

WordPress Trac noreply at wordpress.org
Tue Oct 27 16:42:53 UTC 2020


#49404: WP_REST_Request->parse_json_params only supports 'application/json'
-------------------------------------------------+-------------------------
 Reporter:  pfefferle                            |       Owner:
                                                 |  TimothyBlynJacobs
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  5.6
Component:  REST API                             |     Version:  4.4
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  good-first-bug has-patch has-unit-   |     Focuses:  rest-api
  tests                                          |
-------------------------------------------------+-------------------------
Changes (by TimothyBlynJacobs):

 * owner:  (none) => TimothyBlynJacobs
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"49329" 49329]:
 {{{
 #!CommitTicketReference repository="" revision="49329"
 REST API: Support a broader range of JSON media types.

 Previously, we only supported `application/json` which prevented using
 subtypes like `application/activity+json`. This allows for the REST API to
 `json_decode` the body of requests using a JSON subtype `Content-Type`.
 Additionally, `wp_die()` now properly sends the error as JSON when a JSON
 subtype is specified in the `Accept` header.

 Props pfefferle.
 Fixes #49404.
 }}}

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


More information about the wp-trac mailing list