From 4e2e43ede39ac415b2e61ee4370025aa6a13dc3e Mon Sep 17 00:00:00 2001 From: dbuechel Date: Tue, 13 Mar 2018 09:13:35 +0100 Subject: [PATCH] SEBWIN-219: Corrected handling of URIs in configuration request detection. --- SafeExamBrowser.Browser/Handlers/RequestHandler.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SafeExamBrowser.Browser/Handlers/RequestHandler.cs b/SafeExamBrowser.Browser/Handlers/RequestHandler.cs index f8abbde7..55f91fbe 100644 --- a/SafeExamBrowser.Browser/Handlers/RequestHandler.cs +++ b/SafeExamBrowser.Browser/Handlers/RequestHandler.cs @@ -6,7 +6,9 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +using System; using System.ComponentModel; +using System.IO; using System.Threading.Tasks; using CefSharp; using CefSharp.Handler; @@ -27,9 +29,9 @@ namespace SafeExamBrowser.Browser.Handlers Task.Run(() => { var allow = true; + var uri = new Uri(request.Url); - // TODO: Check if the requested resource is a configuration file, even if the URL does not indicate so! - if (request.Url.StartsWith("seb") || request.Url.StartsWith("sebs") || request.Url.EndsWith(".seb")) + if (uri.Scheme == "seb" || uri.Scheme == "sebs" || Path.HasExtension("seb")) { var args = new CancelEventArgs();