From: Bartosz DziewoƄski Date: Sat, 29 Aug 2015 18:44:08 +0000 (+0200) Subject: mediawiki.ForeignApi: Use `type === 'POST'` instead of `type !== 'GET'` X-Git-Tag: 1.31.0-rc.0~10214 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=7f97802fa789161ae8a314bd3fb381855cc49532;p=lhc%2Fweb%2Fwiklou.git mediawiki.ForeignApi: Use `type === 'POST'` instead of `type !== 'GET'` 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 --- diff --git a/resources/src/mediawiki.api/mediawiki.ForeignApi.js b/resources/src/mediawiki.api/mediawiki.ForeignApi.js index 74e80e2b45..b8cc059819 100644 --- a/resources/src/mediawiki.api/mediawiki.ForeignApi.js +++ b/resources/src/mediawiki.api/mediawiki.ForeignApi.js @@ -90,7 +90,7 @@ 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 ? '&' : '?' ) +