From 3a250132b33822047517fa33ed0a694d05dbb2f1 Mon Sep 17 00:00:00 2001 From: djbadders <34887832+djbadders@users.noreply.github.com> Date: Tue, 23 Feb 2021 21:27:42 +0000 Subject: [PATCH] Improvement to the security to clear any content from the rendering pipeline before redirect --- Monitor/_Internal/BasePageModelSecure.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Monitor/_Internal/BasePageModelSecure.cs b/Monitor/_Internal/BasePageModelSecure.cs index 080b8ef..d0a2917 100644 --- a/Monitor/_Internal/BasePageModelSecure.cs +++ b/Monitor/_Internal/BasePageModelSecure.cs @@ -1,4 +1,5 @@ -using System; +using System.Net; +using System; using Microsoft.AspNetCore.Http; using Core.Main; using Core.Helper; @@ -27,7 +28,8 @@ namespace Monitor._Internal // Security check if (!IsLoggedIn(this.HttpContext)) { - HttpContext.Response.Redirect(PTMagicConfiguration.GeneralSettings.Monitor.RootUrl + _redirectUrl); + this.HttpContext.Response.Clear(); + this.HttpContext.Response.Redirect(PTMagicConfiguration.GeneralSettings.Monitor.RootUrl + _redirectUrl); } }