[wp-trac] [WordPress Trac] #39150: Empty JSON Payload Causes rest_invalid_json

WordPress Trac noreply at wordpress.org
Tue Dec 13 03:33:16 UTC 2016


#39150: Empty JSON Payload Causes rest_invalid_json
---------------------------------------------+----------------------
 Reporter:  GamerZ                           |       Owner:  jnylen0
     Type:  defect (bug)                     |      Status:  closed
 Priority:  normal                           |   Milestone:  4.7.1
Component:  REST API                         |     Version:  4.7
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
---------------------------------------------+----------------------
Changes (by jnylen0):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"39594"]:
 {{{
 #!CommitTicketReference repository="" revision="39594"
 REST API: Do not error on empty JSON body

 It's fairly common for clients to send `Content-Type: application/json`
 with an
 empty body.  While technically not valid JSON, we've historically
 supported
 this behaviour, so it shouldn't cause an error.

 Props JPry.
 Fixes #39150.
 }}}

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


More information about the wp-trac mailing list