From 3e2901ad8c17a2cff59d2a3623ebe1a96164aeb5 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 18 Feb 2019 10:57:20 -0800 Subject: 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 --- onionshare/web/receive_mode.py | 2 +- share/static/js/receive.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/onionshare/web/receive_mode.py b/onionshare/web/receive_mode.py index fa9909ae..d6ef86ad 100644 --- a/onionshare/web/receive_mode.py +++ b/onionshare/web/receive_mode.py @@ -79,7 +79,7 @@ class ReceiveModeWeb(object): }) 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: self.common.log('ReceiveModeWeb', 'define_routes', '/upload, there was an upload error') diff --git a/share/static/js/receive.js b/share/static/js/receive.js index 02c37b3f..c29c726c 100644 --- a/share/static/js/receive.js +++ b/share/static/js/receive.js @@ -121,7 +121,7 @@ $(function(){ $('#uploads').append($upload_div); // 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); }); }); -- cgit v1.2.3-54-g00ecf