mirror of
https://git.deluge-torrent.org/deluge
synced 2025-09-18 15:51:57 +00:00
fix #1481 file uploads from behind a reverse proxy
This commit is contained in:
parent
612ed4123f
commit
0b821640bb
1 changed files with 6 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
||||||
/*!
|
/*!
|
||||||
* Deluge.add.File.js
|
* Deluge.add.File.js
|
||||||
*
|
*
|
||||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
@ -51,7 +51,7 @@ Deluge.add.FileWindow = Ext.extend(Deluge.add.Window, {
|
||||||
initComponent: function() {
|
initComponent: function() {
|
||||||
Deluge.add.FileWindow.superclass.initComponent.call(this);
|
Deluge.add.FileWindow.superclass.initComponent.call(this);
|
||||||
this.addButton(_('Add'), this.onAddClick, this);
|
this.addButton(_('Add'), this.onAddClick, this);
|
||||||
|
|
||||||
this.form = this.add({
|
this.form = this.add({
|
||||||
xtype: 'form',
|
xtype: 'form',
|
||||||
baseCls: 'x-plain',
|
baseCls: 'x-plain',
|
||||||
|
@ -71,13 +71,13 @@ Deluge.add.FileWindow = Ext.extend(Deluge.add.Window, {
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// private
|
// private
|
||||||
onAddClick: function(field, e) {
|
onAddClick: function(field, e) {
|
||||||
if (this.form.getForm().isValid()) {
|
if (this.form.getForm().isValid()) {
|
||||||
this.torrentId = this.createTorrentId();
|
this.torrentId = this.createTorrentId();
|
||||||
this.form.getForm().submit({
|
this.form.getForm().submit({
|
||||||
url: '/upload',
|
url: deluge.config.base + 'upload',
|
||||||
waitMsg: _('Uploading your torrent...'),
|
waitMsg: _('Uploading your torrent...'),
|
||||||
failure: this.onUploadFailure,
|
failure: this.onUploadFailure,
|
||||||
success: this.onUploadSuccess,
|
success: this.onUploadSuccess,
|
||||||
|
@ -88,7 +88,7 @@ Deluge.add.FileWindow = Ext.extend(Deluge.add.Window, {
|
||||||
this.fireEvent('beforeadd', this.torrentId, name);
|
this.fireEvent('beforeadd', this.torrentId, name);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// private
|
// private
|
||||||
onGotInfo: function(info, obj, response, request) {
|
onGotInfo: function(info, obj, response, request) {
|
||||||
info['filename'] = request.options.filename;
|
info['filename'] = request.options.filename;
|
||||||
|
@ -99,7 +99,7 @@ Deluge.add.FileWindow = Ext.extend(Deluge.add.Window, {
|
||||||
onUploadFailure: function(form, action) {
|
onUploadFailure: function(form, action) {
|
||||||
this.hide();
|
this.hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
// private
|
// private
|
||||||
onUploadSuccess: function(fp, upload) {
|
onUploadSuccess: function(fp, upload) {
|
||||||
this.hide();
|
this.hide();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue