fixed hidden url implementation finally

This commit is contained in:
Xevion
2019-06-30 05:41:18 -05:00
parent eb9ea9ba41
commit 74f6e6d35c

View File

@@ -89,21 +89,19 @@ def boolparse(string, default=False):
else: else:
return False return False
@app.errorhandler(404) @app.route('/hidden<id>/help')
def page_not_found(e):
return '404<br>${}'.format(app.config['HIDDEN_URL'])
hidden_url = app.config['HIDDEN_URL']
hidden_help_url = hidden_url + '/help'
@app.route(hidden_help_url)
@login_required @login_required
def hidden_help(): def hidden_help(id):
if id != app.config['HIDDEN_URL']:
return 'bad id'
else:
return render_template('hidden_help.html') return render_template('hidden_help.html')
@app.route(hidden_url) @app.route('/hidden<id>')
@login_required @login_required
def hidden(): def hidden(id):
if id != app.config['HIDDEN_URL']:
return 'bad id'
# Handled within request # Handled within request
tags = request.args.get('tags') or 'trap' tags = request.args.get('tags') or 'trap'
try: try: