SEBWIN-219: Corrected handling of URIs in configuration request detection.

This commit is contained in:
dbuechel 2018-03-13 09:13:35 +01:00
parent 993329bd71
commit 4e2e43ede3

View file

@ -6,7 +6,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
using System;
using System.ComponentModel; using System.ComponentModel;
using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using CefSharp; using CefSharp;
using CefSharp.Handler; using CefSharp.Handler;
@ -27,9 +29,9 @@ namespace SafeExamBrowser.Browser.Handlers
Task.Run(() => Task.Run(() =>
{ {
var allow = true; 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 (uri.Scheme == "seb" || uri.Scheme == "sebs" || Path.HasExtension("seb"))
if (request.Url.StartsWith("seb") || request.Url.StartsWith("sebs") || request.Url.EndsWith(".seb"))
{ {
var args = new CancelEventArgs(); var args = new CancelEventArgs();