From a036fbfc43745f4f2ea22a1dc6cef653e64615ce Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Sat, 23 Nov 2013 18:24:22 +0000 Subject: [PATCH] Fix for HTTPS bug --- Site5/Master-v5.master.cs | 4 ++-- Site5/Security/Login.aspx.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Site5/Master-v5.master.cs b/Site5/Master-v5.master.cs index 36f3836f..9e027157 100644 --- a/Site5/Master-v5.master.cs +++ b/Site5/Master-v5.master.cs @@ -62,11 +62,11 @@ namespace Swarmops // Check for SSL and force it - if (!Request.IsSecureConnection || Request.Url.ToString().StartsWith("http://")) // Both are necessary, as some reverse proxies will https-ify an original nonsecure connection + if ((!Request.IsSecureConnection) || Request.Url.ToString().StartsWith("http://")) // Both are necessary, as some reverse proxies will https-ify an original nonsecure connection { if (!Request.Url.ToString().StartsWith("http://dev.swarmops.com/") && !Request.Url.ToString().StartsWith("http://sandbox.swarmops.com") && !Request.Url.ToString().StartsWith("http://localhost:") && !Request.Url.ToString().StartsWith("http://cryptdb")) { - // Response.Redirect(Request.Url.ToString().Replace("http:", "https:")); + Response.Redirect(Request.Url.ToString().Replace("http:", "https:")); // Only force this if set to force it in database // TODO: Make admin init task diff --git a/Site5/Security/Login.aspx.cs b/Site5/Security/Login.aspx.cs index 0de7796e..b4b7532b 100644 --- a/Site5/Security/Login.aspx.cs +++ b/Site5/Security/Login.aspx.cs @@ -33,7 +33,7 @@ namespace Swarmops.Pages.Security // Check for SSL - if (!Request.IsSecureConnection || Request.Url.ToString().StartsWith("http://")) // Both are necessary, as some reverse proxies will https-ify an original nonsecure connection + if ((!Request.IsSecureConnection) || Request.Url.ToString().StartsWith("http://")) // Both are necessary, as some reverse proxies will https-ify an original nonsecure connection { if (!Request.Url.ToString().StartsWith("http://dev.activizr.com/") && !Request.Url.ToString().StartsWith("http://localhost:") && Request.Url.ToString().StartsWith("http://activizr-")) {