Browse Source

Bug fix

pull/5829/head
2dust 2 months ago
parent
commit
53a2fbd0ff
  1. 25
      v2rayN/ServiceLib/Handler/WebDavHandler.cs

25
v2rayN/ServiceLib/Handler/WebDavHandler.cs

@ -98,19 +98,26 @@ namespace ServiceLib.Handler
}
await TryCreateDir();
var testName = "readme_test";
var myContent = new StringContent(testName);
var result = await _client.PutFile($"{_webDir}/{testName}", myContent);
if (result.IsSuccessful)
try
{
await _client.Delete($"{_webDir}/{testName}");
return true;
var testName = "readme_test";
var myContent = new StringContent(testName);
var result = await _client.PutFile($"{_webDir}/{testName}", myContent);
if (result.IsSuccessful)
{
await _client.Delete($"{_webDir}/{testName}");
return true;
}
else
{
SaveLog(result.Description);
}
}
else
catch (Exception ex)
{
SaveLog(result.Description);
return false;
SaveLog(ex);
}
return false;
}
public async Task<bool> PutFile(string fileName)

Loading…
Cancel
Save