Add header to flag API POST requests with no write intentions
authorAaron Schulz <aschulz@wikimedia.org>
Sun, 25 Oct 2015 06:45:02 +0000 (23:45 -0700)
committerOri.livneh <ori@wikimedia.org>
Fri, 6 Nov 2015 22:21:31 +0000 (22:21 +0000)
commitcbdb16da1d8699e87dade377a8271a96e0c178e1
treee4f51e7e7b980199be1ea7a3e6c872e3ae977962
parentbcfe5979d1628f427187d6b5c684108bbe484f09
Add header to flag API POST requests with no write intentions

This performs sanity check that request *is* for a non-write module.
By handling the validation, the CDN layer can simply use the presence
of this header to route POST requests to the local datacenter.
Without validation, users could cause strange traffic patterns and slow
cross-DC database writes (which can involve many RTTs).

This is useful for AJAX widgets that need to post a payload to get a
response, but that don't actually change anything in the process. They
should be able to use the local datacenter.

Bug: T91820
Change-Id: I34248ddee33033e3d1d86c3391236259d917d4a7
includes/WebStart.php
includes/api/ApiMain.php
languages/i18n/en.json
languages/i18n/qqq.json