From: Bartosz DziewoƄski Date: Wed, 14 Sep 2016 17:43:24 +0000 (+0200) Subject: mw.api.upload: Suppress default API call timeout X-Git-Tag: 1.31.0-rc.0~5418^2 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=bd0ac893a0c46739b604176454d3e8cd205578df;p=lhc%2Fweb%2Fwiklou.git mw.api.upload: Suppress default API call timeout mw.Api sets a default timeout of 30 seconds, meaning that if the request takes more than that, it will be aborted. This is reasonable in most cases, but file uploads can easily take longer than that. Bug: T117545 Change-Id: I086108421d229c60f5e9d5c9edb70150d875dcb0 --- diff --git a/resources/src/mediawiki/api/upload.js b/resources/src/mediawiki/api/upload.js index c2da10e2f9..8169449807 100644 --- a/resources/src/mediawiki/api/upload.js +++ b/resources/src/mediawiki/api/upload.js @@ -283,6 +283,8 @@ this[ this.needToken() ? 'postWithEditToken' : 'post' ]( data, { // Use FormData (if we got here, we know that it's available) contentType: 'multipart/form-data', + // No timeout (default from mw.Api is 30 seconds) + timeout: 0, // Provide upload progress notifications xhr: function () { var xhr = $.ajaxSettings.xhr();