[wp-trac] [WordPress Trac] #40444: REST API responses are sent with an empty Last-Modified header.

WordPress Trac noreply at wordpress.org
Fri May 19 18:58:00 UTC 2017


#40444: REST API responses are sent with an empty Last-Modified header.
-------------------------------------------------+-------------------------
 Reporter:  zinigor                              |       Owner:  jnylen0
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  4.8
Component:  REST API                             |     Version:  4.4
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-      |     Focuses:  rest-api
  testing                                        |
-------------------------------------------------+-------------------------
Changes (by jnylen0):

 * keywords:  has-patch needs-testing => has-patch has-unit-tests needs-
     testing
 * owner:   => jnylen0
 * status:  new => assigned
 * milestone:  Awaiting Review => 4.8


Comment:

 I've confirmed this issue on a couple of my test sites.

 In [attachment:40444.3.diff]:

 - In PHP 5.2, only send an empty header if we've already sent the header
 in question.  Mirrors the
 [https://core.trac.wordpress.org/browser/tags/4.7.5/src/wp-
 includes/functions.php?marks=1148-1153#L1126 existing logic from
 `nocache_headers`].
 - Rename the new function from `clear_header` to `remove_header`.
 - Clean up docblocks and comments.

 `nocache_headers` calls `@header_remove` (note error suppression).  I am
 not sure why it's called like that, but this patch does the same.

 While it would be nice to get this in 4.8 for wider testing before
 release, the timing is pretty tight at this point.  I'll milestone it for
 discussion.

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


More information about the wp-trac mailing list