From bd0ac893a0c46739b604176454d3e8cd205578df Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 14 Sep 2016 19:43:24 +0200 Subject: [PATCH] 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 --- resources/src/mediawiki/api/upload.js | 2 ++ 1 file changed, 2 insertions(+) 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(); -- 2.20.1