mw.api.upload: Suppress default API call timeout
authorBartosz Dziewoński <matma.rex@gmail.com>
Wed, 14 Sep 2016 17:43:24 +0000 (19:43 +0200)
committerAnomie <bjorsch@wikimedia.org>
Wed, 21 Sep 2016 18:37:27 +0000 (18:37 +0000)
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

index c2da10e..8169449 100644 (file)
                        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();