mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2026-02-06 14:59:15 -06:00
fixing webrequest node to encode variables in url
This commit is contained in:
Binary file not shown.
@@ -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.
Binary file not shown.
@@ -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;
|
||||
|
||||
BIN
Plex/Plex.csproj
BIN
Plex/Plex.csproj
Binary file not shown.
@@ -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.
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.
Reference in New Issue
Block a user