SEBWIN-471: Fixed bug where reconfiguration URL wasn't mandatory in a secure session.

This commit is contained in:
Damian Büchel 2021-04-19 10:49:02 +02:00
parent 8187799929
commit 417a16ea49

View file

@ -341,13 +341,13 @@ namespace SafeExamBrowser.Client
{
var expression = Regex.Escape(Settings.Security.ReconfigurationUrl).Replace(@"\*", ".*");
var regex = new Regex($"^{expression}$", RegexOptions.IgnoreCase);
var sebUrl = args.Url.Replace(Uri.UriSchemeHttp, context.AppConfig.SebUriScheme).Replace(Uri.UriSchemeHttps, context.AppConfig.SebUriSchemeSecure);
var sebUrl = args.Url.Replace(Uri.UriSchemeHttps, context.AppConfig.SebUriSchemeSecure).Replace(Uri.UriSchemeHttp, context.AppConfig.SebUriScheme);
allow = Settings.Security.AllowReconfiguration && (regex.IsMatch(args.Url) || regex.IsMatch(sebUrl));
}
else
{
allow = Settings.Security.AllowReconfiguration;
logger.Warn("The active configuration does not contain a valid reconfiguration URL!");
}
}
else