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

WordPress Trac noreply at wordpress.org
Mon Apr 24 05:14:14 UTC 2017


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

Comment (by rmccue):

 The current behaviour of calling `$this->send_header` looks to be correct,
 as it goes via the REST API Server abstraction rather than just sending
 the headers. Internally, `nocache_headers` calls
 `wp_get_nocache_headers()` anyway.

 ''However'', `nocache_headers()` also clears the `Last-Modified` header,
 which we aren't doing. We can call `header_remove` or send an empty header
 per #23021. We should add a new `remove_header` method and call that (and
 if that method doesn't exist, call `send_header( 'Last-Modified', '' )`
 for compatibility with existing `WP_REST_Server` subclasses).

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


More information about the wp-trac mailing list