aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--stackbin.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/stackbin.py b/stackbin.py
index 89ec493..2345d5f 100644
--- a/stackbin.py
+++ b/stackbin.py
@@ -316,11 +316,14 @@ def favicon():
@app.route('/set')
def get_proxied_path():
+ prefix = "/"
if 'HTTP_X_FORWARDED_PREFIX' in request.environ:
pl = len(dict(request.headers)["X-Forwarded-Host"].split(", "))
- #prefix = request.environ['HTTP_X_FORWARDED_PREFIX']
+ prefix = request.environ['HTTP_X_FORWARDED_PREFIX']
app.wsgi_app = ProxyFix(app.wsgi_app,x_for=pl,x_host=pl,x_port=pl,x_prefix=pl,x_proto=pl)
- return redirect(url_for('new_paste'))
+ # we can afford to use prefix because new_paste is the top-level endpoint of the whole app
+ message = refresh_string(1, prefix) + "OK"
+ return message, 200
# stubs, to simplify any templates that ask url_for("login")
@app.route('/login/')
bgstack15