From 792a8bc834dd893a5b34537560136455b645d827 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Mon, 28 Nov 2016 13:44:05 +0100 Subject: [PATCH] Added explicit output for the HyperV request and MSSQL requests to return explicitly empty responses on unsupported systems. This should fix #2136 --- Duplicati/Server/WebServer/RESTMethods/HyperV.cs | 6 ++++-- Duplicati/Server/WebServer/RESTMethods/MSSQL.cs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Duplicati/Server/WebServer/RESTMethods/HyperV.cs b/Duplicati/Server/WebServer/RESTMethods/HyperV.cs index f1eeb2fd9..5bb2e8fcc 100644 --- a/Duplicati/Server/WebServer/RESTMethods/HyperV.cs +++ b/Duplicati/Server/WebServer/RESTMethods/HyperV.cs @@ -29,6 +29,8 @@ namespace Duplicati.Server.WebServer.RESTMethods // Early exit in case we are non-windows to prevent attempting to load Windows-only components if (Library.Utility.Utility.IsClientWindows) RealGET(key, info); + else + info.OutputOK(new string[0]); } // Make sure the JIT does not attempt to inline this call and thus load @@ -40,7 +42,7 @@ namespace Duplicati.Server.WebServer.RESTMethods if (!hypervUtility.IsHyperVInstalled) { - info.OutputOK(); + info.OutputOK(new string[0]); return; } @@ -64,7 +66,7 @@ namespace Duplicati.Server.WebServer.RESTMethods } catch (Exception ex) { - info.ReportClientError("Failed to enumerate Hyper-V virtual machines: " + ex.Message); + info.ReportServerError("Failed to enumerate Hyper-V virtual machines: " + ex.Message); } } diff --git a/Duplicati/Server/WebServer/RESTMethods/MSSQL.cs b/Duplicati/Server/WebServer/RESTMethods/MSSQL.cs index 7ad9c6bfb..5d2c9f701 100644 --- a/Duplicati/Server/WebServer/RESTMethods/MSSQL.cs +++ b/Duplicati/Server/WebServer/RESTMethods/MSSQL.cs @@ -29,6 +29,8 @@ namespace Duplicati.Server.WebServer.RESTMethods // Early exit in case we are non-windows to prevent attempting to load Windows-only components if (Library.Utility.Utility.IsClientWindows) RealGET(key, info); + else + info.OutputOK(new string[0]); } // Make sure the JIT does not attempt to inline this call and thus load @@ -40,7 +42,7 @@ namespace Duplicati.Server.WebServer.RESTMethods if (!mssqlUtility.IsMSSQLInstalled) { - info.OutputOK(); + info.OutputOK(new string[0]); return; } @@ -62,7 +64,7 @@ namespace Duplicati.Server.WebServer.RESTMethods } catch (Exception ex) { - info.ReportClientError("Failed to enumerate Microsoft SQL Server databases: " + ex.Message); + info.ReportServerError("Failed to enumerate Microsoft SQL Server databases: " + ex.Message); } }