summaryrefslogtreecommitdiff
path: root/onionshare
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2019-05-21 10:18:40 -0700
committerMicah Lee <micah@micahflee.com>2019-05-21 10:18:40 -0700
commit63ced5625028f42331eab729639534c8064ba352 (patch)
tree18b8f1619f1862d9c31244c74b01b112392287a4 /onionshare
parent97b5984afff1b00743380e775b961eac5ff3b3a7 (diff)
downloadonionshare-63ced5625028f42331eab729639534c8064ba352.tar.gz
onionshare-63ced5625028f42331eab729639534c8064ba352.zip
Update ReceiveMode to no longer rely on slugs
Diffstat (limited to 'onionshare')
-rw-r--r--onionshare/web/receive_mode.py30
1 files changed, 5 insertions, 25 deletions
diff --git a/onionshare/web/receive_mode.py b/onionshare/web/receive_mode.py
index af146cb0..60f421fa 100644
--- a/onionshare/web/receive_mode.py
+++ b/onionshare/web/receive_mode.py
@@ -34,15 +34,7 @@ class ReceiveModeWeb(object):
@self.web.app.route("/")
def index():
self.web.add_request(self.web.REQUEST_LOAD, request.path)
-
- if self.common.settings.get('public_mode'):
- upload_action = '/upload'
- else:
- upload_action = '/{}/upload'.format(self.web.password)
-
- r = make_response(render_template(
- 'receive.html',
- upload_action=upload_action))
+ r = make_response(render_template('receive.html'))
return self.web.add_security_headers(r)
@self.web.app.route("/upload", methods=['POST'])
@@ -83,11 +75,7 @@ class ReceiveModeWeb(object):
return json.dumps({"error_flashes": [msg]})
else:
flash(msg, 'error')
-
- if self.common.settings.get('public_mode'):
- return redirect('/')
- else:
- return redirect('/{}'.format(password_candidate))
+ return redirect('/')
# Note that flash strings are in English, and not translated, on purpose,
# to avoid leaking the locale of the OnionShare user
@@ -114,11 +102,7 @@ class ReceiveModeWeb(object):
if ajax:
return json.dumps({"info_flashes": info_flashes})
else:
- if self.common.settings.get('public_mode'):
- path = '/'
- else:
- path = '/{}'.format(password_candidate)
- return redirect('{}'.format(path))
+ return redirect('/')
else:
if ajax:
return json.dumps({"new_body": render_template('thankyou.html')})
@@ -234,12 +218,8 @@ class ReceiveModeRequest(Request):
# Is this a valid upload request?
self.upload_request = False
if self.method == 'POST':
- if self.web.common.settings.get('public_mode'):
- if self.path == '/upload' or self.path == '/upload-ajax':
- self.upload_request = True
- else:
- if self.path == '/{}/upload'.format(self.web.password) or self.path == '/{}/upload-ajax'.format(self.web.password):
- self.upload_request = True
+ if self.path == '/upload' or self.path == '/upload-ajax':
+ self.upload_request = True
if self.upload_request:
# No errors yet