From d68b9510bb6e3637128cd5ee255b1dc75808240e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Wed, 2 Dec 2015 16:17:07 +0200 Subject: [PATCH] request.build_absolute_uri() behind a reverse proxy doesn't build https links. Construct URLs using settings.SITE_ROOT instead. --- hc/front/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hc/front/views.py b/hc/front/views.py index 14eb8df1..61f9f56e 100644 --- a/hc/front/views.py +++ b/hc/front/views.py @@ -337,8 +337,8 @@ def add_pushover(request): nonce = get_random_string() request.session["po_nonce"] = nonce - failure_url = request.build_absolute_uri(reverse("hc-channels")) - success_url = request.build_absolute_uri(reverse("hc-add-pushover")) + "?" + urlencode({ + failure_url = settings.SITE_ROOT + reverse("hc-channels") + success_url = settings.SITE_ROOT + reverse("hc-add-pushover") + "?" + urlencode({ "nonce": nonce, "prio": request.POST.get("po_priority", "0"), })