aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2019-02-18 10:57:20 -0800
committerMicah Lee <micah@micahflee.com>2019-02-18 10:57:20 -0800
commit3e2901ad8c17a2cff59d2a3623ebe1a96164aeb5 (patch)
treea394e8a36fc31e2daa07080ef74cfbb11c148635
parent879cf687b16e4bf67ba114a8e9f68851938744e1 (diff)
downloadonionshare-3e2901ad8c17a2cff59d2a3623ebe1a96164aeb5.tar.gz
onionshare-3e2901ad8c17a2cff59d2a3623ebe1a96164aeb5.zip
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
-rw-r--r--onionshare/web/receive_mode.py2
-rw-r--r--share/static/js/receive.js2
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);
});
});