[wp-trac] [WordPress Trac] #40787: REST API: Attempts to output headers without confirming headers have not been sent

WordPress Trac noreply at wordpress.org
Thu May 18 17:48:40 UTC 2017


#40787: REST API: Attempts to output headers without confirming headers have not
been sent
------------------------------------+-----------------------
 Reporter:  kraftbj                 |       Owner:  jnylen0
     Type:  defect (bug)            |      Status:  closed
 Priority:  normal                  |   Milestone:  4.8
Component:  REST API                |     Version:
 Severity:  normal                  |  Resolution:  fixed
 Keywords:  has-patch dev-feedback  |     Focuses:  rest-api
------------------------------------+-----------------------
Changes (by jnylen0):

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


Comment:

 In [changeset:"40782"]:
 {{{
 #!CommitTicketReference repository="" revision="40782"
 REST API: Do not set `X-WP-Deprecated*` headers as often.

 Only set these headers if (1) `WP_DEBUG` is enabled and (2) headers have
 not already been sent.

 Previously, this code could generate warnings by trying to set a header
 after response data has already been sent.  This happens when code
 attached to the `shutdown` filter calls a deprecated function, for
 example.

 Also, these headers are unlikely to be useful in the majority of cases;
 let's only send them if `WP_DEBUG` is enabled.

 Props kraftbj, jnylen0, ocean90, rmccue.
 Fixes #40787.
 }}}

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


More information about the wp-trac mailing list