SEBWIN-934: Ensured window title of active application is always current and fixed encoding of screen shot metadata.
This commit is contained in:
parent
f096b96741
commit
4c0f3cfa6c
2 changed files with 9 additions and 2 deletions
|
@ -98,7 +98,13 @@ namespace SafeExamBrowser.Monitoring.Applications
|
||||||
|
|
||||||
if (activeWindow != default && TryGetProcessFor(activeWindow, out var process))
|
if (activeWindow != default && TryGetProcessFor(activeWindow, out var process))
|
||||||
{
|
{
|
||||||
application = new ActiveApplication(process, new Window { Handle = activeWindow.Handle, Title = activeWindow.Title });
|
var window = new Window
|
||||||
|
{
|
||||||
|
Handle = activeWindow.Handle,
|
||||||
|
Title = nativeMethods.GetWindowTitle(activeWindow.Handle)
|
||||||
|
};
|
||||||
|
|
||||||
|
application = new ActiveApplication(process, window);
|
||||||
}
|
}
|
||||||
|
|
||||||
return application != default;
|
return application != default;
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using SafeExamBrowser.Logging.Contracts;
|
using SafeExamBrowser.Logging.Contracts;
|
||||||
using SafeExamBrowser.Proctoring.ScreenProctoring.Data;
|
using SafeExamBrowser.Proctoring.ScreenProctoring.Data;
|
||||||
|
@ -24,7 +25,7 @@ namespace SafeExamBrowser.Proctoring.ScreenProctoring.Service.Requests
|
||||||
internal bool TryExecute(MetaData metaData, ScreenShot screenShot, string sessionId, out int health, out string message)
|
internal bool TryExecute(MetaData metaData, ScreenShot screenShot, string sessionId, out int health, out string message)
|
||||||
{
|
{
|
||||||
var imageFormat = (Header.IMAGE_FORMAT, ToString(screenShot.Format));
|
var imageFormat = (Header.IMAGE_FORMAT, ToString(screenShot.Format));
|
||||||
var metdataJson = (Header.METADATA, metaData.ToJson());
|
var metdataJson = (Header.METADATA, WebUtility.UrlEncode(metaData.ToJson()));
|
||||||
var timestamp = (Header.TIMESTAMP, screenShot.CaptureTime.ToUnixTimestamp().ToString());
|
var timestamp = (Header.TIMESTAMP, screenShot.CaptureTime.ToUnixTimestamp().ToString());
|
||||||
var url = api.ScreenShotEndpoint.Replace(Api.SESSION_ID, sessionId);
|
var url = api.ScreenShotEndpoint.Replace(Api.SESSION_ID, sessionId);
|
||||||
var success = TryExecute(HttpMethod.Post, url, out var response, screenShot.Data, ContentType.OCTET_STREAM, Authorization, imageFormat, metdataJson, timestamp);
|
var success = TryExecute(HttpMethod.Post, url, out var response, screenShot.Data, ContentType.OCTET_STREAM, Authorization, imageFormat, metdataJson, timestamp);
|
||||||
|
|
Loading…
Reference in a new issue