Compare commits
No commits in common. "784455fe1d4650ad02f732b635b739194c348268" and "2d68de54ac9871df2bac4774f4e32604f9aca183" have entirely different histories.
784455fe1d
...
2d68de54ac
15
main.py
15
main.py
@ -22,17 +22,9 @@ def send_report(path):
|
||||
@app.route('/')
|
||||
def index():
|
||||
params = request.args
|
||||
if 'r' in request.cookies:
|
||||
print("Referer: " + request.cookies['r'])
|
||||
return render_template('index.html', hidden=request.cookies['r'],address=address)
|
||||
|
||||
|
||||
if 'r' in params:
|
||||
print("Referer: " + params['r'])
|
||||
# Set cookie
|
||||
resp = make_response(render_template('index.html', hidden=params['r'],address=address))
|
||||
resp.set_cookie('r', params['r'], max_age=60*60*24)
|
||||
return resp
|
||||
return render_template('index.html', hidden=params['r'],address=address)
|
||||
|
||||
return render_template('index.html',address=address)
|
||||
|
||||
@ -53,9 +45,6 @@ def submit():
|
||||
if hidden == '':
|
||||
hidden = 'None'
|
||||
|
||||
if 'r' in request.cookies:
|
||||
hidden = request.cookies['r']
|
||||
|
||||
status = gift.gift(name, email, hidden, ip)
|
||||
print(status,flush=True)
|
||||
|
||||
@ -110,7 +99,7 @@ def catch_all(path):
|
||||
# # Try with .html
|
||||
# if os.path.isfile('templates/' + path + '.html'):
|
||||
# return render_template(path + '.html')
|
||||
return redirect('/?r='+path)
|
||||
return redirect('/')
|
||||
|
||||
# 404 catch all
|
||||
@app.errorhandler(404)
|
||||
|
Loading…
Reference in New Issue
Block a user