API: Allow anonymous CORS from anywhere, when specifically requested
authorBrad Jorsch <bjorsch@wikimedia.org>
Fri, 8 Apr 2016 17:05:25 +0000 (13:05 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Wed, 8 Jun 2016 18:59:55 +0000 (14:59 -0400)
commitd83e655b8e033019b445de948bee00bec5fdb948
tree9b928912dc3bddc1fa4b786cd21607eabf21826e
parent69c8de34ad4ed1b9900aeb02cf66af4e502e582f
API: Allow anonymous CORS from anywhere, when specifically requested

This allows any external site to do with CORS what they can already do
with jsonp: submit a request that will be processed as if logged out.

This is done by accepting '*' as a value for the existing 'origin' URL
parameter that is currently required in order to do any CORS requests
against MediaWiki.

The response to such a request will specifically include
"Access-Control-Allow-Credentials: false" to instruct the browser not to
send cookies or other authentication data, and further the API will
apply all the same restrictions (forcing an anonymous user and
forbidding certain actions such as token fetch) that it currently does
for jsonp requests.

Bug: T62835
Change-Id: I30e359fb23f0511242dfb4bff68718668947aaf5
includes/api/ApiMain.php