fixing webrequest node to encode variables in url

This commit is contained in:
John Andrews
2022-04-21 11:50:16 +12:00
parent 60ec00e2f5
commit e3ac0a0de1
23 changed files with 10 additions and 3 deletions

Binary file not shown.

View File

@@ -84,7 +84,13 @@ public class WebRequest : Node
{
using var client = new HttpClient();
string url = args.ReplaceVariables(this.Url, stripMissing: true);
string url = VariablesHelper.ReplaceVariables(this.Url, args.Variables, true, false, encoder: (string input) =>
{
if (string.IsNullOrEmpty(input))
return string.Empty;
return Uri.EscapeDataString(input);
});
HttpMethod method = this.Method switch
{

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -85,7 +85,7 @@ public class PlexUpdater: Node
if (updateResponse.success == false)
{
if(string.IsNullOrWhiteSpace(updateResponse.body) == false)
args.Logger.WLog("Failed to update Plex:" + updateResponse.body);
args.Logger?.WLog("Failed to update Plex:" + updateResponse.body);
return 2;
}
return 1;

Binary file not shown.

View File

@@ -1,6 +1,6 @@
#if(DEBUG)
using FileFlows.Plex.Media;
using FileFlows.Plex.MediaManagement;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace FileFlows.Plex.Tests;
@@ -20,6 +20,7 @@ public class PlexTests
var node = new PlexUpdater();
Assert.AreEqual(1, node.Execute(args));
}
[TestMethod]
public void Plex_Fail()
{

Binary file not shown.