API: Add support for selected HTTP precondition headers
authorBrad Jorsch <bjorsch@wikimedia.org>
Mon, 17 Aug 2015 20:52:09 +0000 (16:52 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Thu, 10 Sep 2015 14:19:25 +0000 (10:19 -0400)
commiteb6bea8b54ab487fdd23eb0f001785f850720b0c
tree367fc3167f242cfbeb0655339823a268155f5146
parentf50ab003d803d47bfe67b02e0c0de9c9f29bf915
API: Add support for selected HTTP precondition headers

Specifically, GET requests can now return ETag and Last-Modified
headers, and If-None-Match and If-Modified-Since headers on such GET
requests will be honored. This doesn't change any API modules to
actually return these values, it just provides the infrastructure.

For reasoning on why only GET requests and why only these two of the
five precondition headers defined by RFC 7232, see the doc comment on
ApiMain::checkConditionalRequestHeaders().

Change-Id: Ia18874c9360fcffdad323b341ca867ba773788fd
RELEASE-NOTES-1.26
includes/api/ApiBase.php
includes/api/ApiMain.php
tests/phpunit/includes/api/ApiMainTest.php