mw.ForeignApi: Allow anonymous requests
authorBartosz Dziewoński <matma.rex@gmail.com>
Sat, 10 Sep 2016 19:01:26 +0000 (21:01 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Sat, 10 Sep 2016 19:05:04 +0000 (21:05 +0200)
commitd40cb987989069328983392ba2b1ff857811211e
tree15e833a88afaa2e22d17ded5cc4cc9c1d00f023f
parentb95260df1bd2c9caede3e93493dd40b2ae5441be
mw.ForeignApi: Allow anonymous requests

When 'anonymous: true' is passed:

* Send 'origin=*' in the query parameters, so that MediaWiki treats
  the request as anonymous (same as for JSONP requests).
* Set 'withCredentials: false' in AJAX options, so that the browser
  doesn't try to send cookies and accepts the response with the
  'Access-Control-Allow-Origin: *' header.

Bug: T145294
Change-Id: Ic93d733cb9e1b1d7301f8975c68ab7ded778845a
resources/src/mediawiki/ForeignApi.js