Besides being used for caching of the responses of GET requests,
the ETag and Last-Modified headers can be used with PUT and POST
requests to control the conditional execution of requests using
the If-Match and If-Unmodified-Since headers.
For that reason it is important to distinguish between the ETag and
modification date of a resource at the time a request is received
(before the resource is modified), and at the time the response is
being sent (after the resource has been modified). The before-state
is used to check conditionals, while the after-state can be sent back
to the client in the response.
For a GET request, it is reasonable to re-use the ETag and Last-Modified
values that were used to check conditionals in the response.
For PUT and POST, that would generally be wrong, since the resource has
since changed.
Bug: T311819
Change-Id: I1a09b0ef35ae2365e0b261fb5295003aec1f5b17
THis introduces Handler::getRouteUrl() and uses it in
PageHistoryHandler() to generate self-reference links to adjacent
segments of the response.
Bug: T252566
Change-Id: Ie7b2c6cc63c8a499d4714336b917a9e3328294ca
This adds unit tests for the Handler base class.
This includes tests for public and protected methods.
Since the Handler base class is an extension point, the protected methods
are part of the stable public interface.
Change-Id: Ibe9fcbb139683dad03b92cd0618c3c0e8feb8b94