diff options
author | Kenneth Hsu <kennethhsu@gmail.com> | 2020-08-24 06:05:04 +0300 |
---|---|---|
committer | Kenneth Hsu <kennethhsu@gmail.com> | 2020-08-24 17:41:00 +0300 |
commit | e59e9a42b8eb4d570a6371d13f62af79417d0aed (patch) | |
tree | cc45a6a395319e28d2a7a370cf31465d5cbe36aa /Duplicati/Server | |
parent | 9dd98457f1a335ff4b44ba2d31730d7625a7e67f (diff) |
Extract removal of passwords to method.
This makes it easier to create a simple test for the behavior.
Diffstat (limited to 'Duplicati/Server')
-rw-r--r-- | Duplicati/Server/WebServer/RESTMethods/Backup.cs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Duplicati/Server/WebServer/RESTMethods/Backup.cs b/Duplicati/Server/WebServer/RESTMethods/Backup.cs index e3f2069e5..926e7ba80 100644 --- a/Duplicati/Server/WebServer/RESTMethods/Backup.cs +++ b/Duplicati/Server/WebServer/RESTMethods/Backup.cs @@ -122,6 +122,12 @@ namespace Duplicati.Server.WebServer.RESTMethods info.OutputOK(new { inuse = Library.Main.DatabaseLocator.IsDatabasePathInUse(backup.DBPath) });
}
+ public static void RemovePasswords(IBackup backup)
+ {
+ backup.SanitizeSettings();
+ backup.SanitizeTargetUrl();
+ }
+
private void Export(IBackup backup, RequestInfo info)
{
var cmdline = Library.Utility.Utility.ParseBool(info.Request.QueryString["cmdline"].Value, false);
@@ -129,8 +135,7 @@ namespace Duplicati.Server.WebServer.RESTMethods var exportPasswords = Library.Utility.Utility.ParseBool(info.Request.QueryString["export-passwords"].Value, false);
if (!exportPasswords)
{
- backup.SanitizeSettings();
- backup.SanitizeTargetUrl();
+ Backup.RemovePasswords(backup);
}
if (cmdline)
|