From 3a23cec2c22eaf25185ec149b212c6cdcc3849bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20B=C3=BCchel?= Date: Thu, 24 Sep 2020 17:01:23 +0200 Subject: [PATCH] SEBWIN-414: Ensured query string parameter is correctly appended to start URL. --- SafeExamBrowser.Browser/BrowserApplication.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/SafeExamBrowser.Browser/BrowserApplication.cs b/SafeExamBrowser.Browser/BrowserApplication.cs index 3950afff..e86f2dae 100644 --- a/SafeExamBrowser.Browser/BrowserApplication.cs +++ b/SafeExamBrowser.Browser/BrowserApplication.cs @@ -207,7 +207,14 @@ namespace SafeExamBrowser.Browser if (settings.UseQueryParameter) { - url = $"{url}{settings.StartUrlQuery}"; + if (url.Contains("?") && settings.StartUrlQuery?.Length > 1 && Uri.TryCreate(url, UriKind.Absolute, out var uri)) + { + url = url.Replace(uri.Query, $"{uri.Query}&{settings.StartUrlQuery.Substring(1)}"); + } + else + { + url = $"{url}{settings.StartUrlQuery}"; + } } return url;