[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 20:26:50 UTC 2017
#40444: REST API responses are sent with an empty Last-Modified header.
-------------------------------------------------+-------------------------
Reporter: zinigor | Owner: jnylen0
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 4.8
Component: REST API | Version: 4.4
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests needs- | Focuses: rest-api
testing |
-------------------------------------------------+-------------------------
Changes (by jnylen0):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"40805"]:
{{{
#!CommitTicketReference repository="" revision="40805"
REST API: Avoid sending blank `Last-Modified` headers with authenticated
requests.
This commit adds a new `WP_REST_Server#remove_header` method and uses it
to clear the `Last-Modified` header when the "no caching" headers are sent
(by default for all authenticated REST API requests). This matches the
behavior of the `nocache_headers` function used in other parts of
WordPress.
Previously, the REST API would send an empty `Last-Modified` header in
this situation. Under some server and browser configurations, this causes
browsers to cache authenticated REST API requests, which is undesirable.
Props iv3rson76, zinigor, rmccue, jnylen0.
Fixes #40444.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40444#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list