mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-07 06:13:03 -04:00
Fix minor bugs: When making the ajax POST request, strip the trailing slash from window.location.pathname so the URL works in public mode; and add a newline before printing message when receiving file
This commit is contained in:
parent
b5730f1e45
commit
2220281e80
2 changed files with 2 additions and 2 deletions
|
@ -79,7 +79,7 @@ class ReceiveModeWeb(object):
|
||||||
})
|
})
|
||||||
|
|
||||||
self.common.log('ReceiveModeWeb', 'define_routes', '/upload, uploaded {}, saving to {}'.format(f.filename, local_path))
|
self.common.log('ReceiveModeWeb', 'define_routes', '/upload, uploaded {}, saving to {}'.format(f.filename, local_path))
|
||||||
print(strings._('receive_mode_received_file').format(local_path))
|
print('\n' + strings._('receive_mode_received_file').format(local_path))
|
||||||
|
|
||||||
if request.upload_error:
|
if request.upload_error:
|
||||||
self.common.log('ReceiveModeWeb', 'define_routes', '/upload, there was an upload error')
|
self.common.log('ReceiveModeWeb', 'define_routes', '/upload, there was an upload error')
|
||||||
|
|
|
@ -121,7 +121,7 @@ $(function(){
|
||||||
$('#uploads').append($upload_div);
|
$('#uploads').append($upload_div);
|
||||||
|
|
||||||
// Send the request
|
// Send the request
|
||||||
ajax.open('POST', window.location.pathname + '/upload-ajax', true);
|
ajax.open('POST', window.location.pathname.replace(/\/$/, '') + '/upload-ajax', true);
|
||||||
ajax.send(formData);
|
ajax.send(formData);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue