diff --git a/EDEngineer.Server/Server.fs b/EDEngineer.Server/Server.fs index 84ad41e1..4ead6dde 100644 --- a/EDEngineer.Server/Server.fs +++ b/EDEngineer.Server/Server.fs @@ -300,7 +300,7 @@ let start (token, (request(fun request -> let timestampString = match request.queryParam "last" with | Choice1Of2 s -> Some(s) - | Choice2Of2 other -> None + | Choice2Of2 _ -> None cmdr { let! state = stateRoute commander @@ -314,7 +314,12 @@ let start (token, | _ -> false) return (operations, l) |> FormatPicker(f) |> OK >=> MimeType(f) }))) - + + OPTIONS >=> + fun context -> + context |> ( + OK "CORS approved" ) + NOT_FOUND "Route not found" ] >=> setHeader "Access-Control-Allow-Origin" "*" >=> cors corsConfig startWebServer { diff --git a/EDEngineer/EDEngineer.csproj b/EDEngineer/EDEngineer.csproj index 5a6b6623..fdda23ae 100644 --- a/EDEngineer/EDEngineer.csproj +++ b/EDEngineer/EDEngineer.csproj @@ -32,8 +32,8 @@ true publish.htm false - 9 - 1.1.2.9 + 10 + 1.1.2.10 true true true diff --git a/EDEngineer/Utils/System/ServerBridge.cs b/EDEngineer/Utils/System/ServerBridge.cs index b4e6613a..a25889b4 100644 --- a/EDEngineer/Utils/System/ServerBridge.cs +++ b/EDEngineer/Utils/System/ServerBridge.cs @@ -94,7 +94,10 @@ public void Stop() public void Dispose() { - Stop(); + if (cts?.IsCancellationRequested == false) + { + cts.Cancel(); + } } private bool TryGetPort(out ushort port)