Works better when 'type' is not set (which can happen if someone is
calling #ajax directly rather than #get or #post), is consistent
with code in mediawiki.api, and better reflects what we really mean.
Change-Id: Iea265be5c0e6113e91e700124ac36a0b588ca25c
var url, origin, newAjaxOptions;
// 'origin' query parameter must be part of the request URI, and not just POST request body
- if ( ajaxOptions.type !== 'GET' ) {
+ if ( ajaxOptions.type === 'POST' ) {
url = ( ajaxOptions && ajaxOptions.url ) || this.defaults.ajax.url;
origin = ( parameters && parameters.origin ) || this.defaults.parameters.origin;
url += ( url.indexOf( '?' ) !== -1 ? '&' : '?' ) +