Disable dropzone's timeout (#12024) (#12032)

Dropzone 4.4 introduced a 30s XHR timeout that will kill any upload
still in progress. This disable that timeout again.

Ref: https://www.dropzonejs.com/#config-timeout
Ref: https://github.com/go-gitea/gitea/pull/10645
Ref: https://xhr.spec.whatwg.org/#the-timeout-attribute
Fixes: https://github.com/go-gitea/gitea/issues/12022
Fixes: https://github.com/go-gitea/gitea/issues/11906

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
pull/12058/head
silverwind 4 years ago committed by GitHub
parent 12f51ec7dd
commit d059156c3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      web_src/js/index.js

@ -915,6 +915,7 @@ async function initRepository() {
dictInvalidFileType: $dropzone.data('invalid-input-type'), dictInvalidFileType: $dropzone.data('invalid-input-type'),
dictFileTooBig: $dropzone.data('file-too-big'), dictFileTooBig: $dropzone.data('file-too-big'),
dictRemoveFile: $dropzone.data('remove-file'), dictRemoveFile: $dropzone.data('remove-file'),
timeout: 0,
init() { init() {
this.on('success', (file, data) => { this.on('success', (file, data) => {
filenameDict[file.name] = { filenameDict[file.name] = {
@ -2308,6 +2309,7 @@ $(document).ready(async () => {
dictInvalidFileType: $dropzone.data('invalid-input-type'), dictInvalidFileType: $dropzone.data('invalid-input-type'),
dictFileTooBig: $dropzone.data('file-too-big'), dictFileTooBig: $dropzone.data('file-too-big'),
dictRemoveFile: $dropzone.data('remove-file'), dictRemoveFile: $dropzone.data('remove-file'),
timeout: 0,
init() { init() {
this.on('success', (file, data) => { this.on('success', (file, data) => {
filenameDict[file.name] = data.uuid; filenameDict[file.name] = data.uuid;

Loading…
Cancel
Save