Skip to content

Commit 2b7a777

Browse files
authored
Merge pull request #405 from serverlessworkflow/fix-uri-evaluation
Fixed the way both the `HttpCallProcessor` and `OpenApiCallProcessor` evaluate endpoint URIs
2 parents df8e956 + a612def commit 2b7a777

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/runner/Synapse.Runner/Services/Executors/HttpCallExecutor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ protected override async Task DoExecuteAsync(CancellationToken cancellationToken
131131
}
132132
}
133133
var uri = StringFormatter.NamedFormat(this.Http.EndpointUri.OriginalString, this.Task.Input.ToDictionary());
134-
if (uri.IsRuntimeExpression()) uri = await this.Task.Workflow.Expressions.EvaluateAsync<string>(uri, this.Task.Input, this.Task.Arguments, cancellationToken).ConfigureAwait(false);
134+
if (uri.IsRuntimeExpression()) uri = await this.Task.Workflow.Expressions.EvaluateAsync<string>(uri, this.Task.Input, this.GetExpressionEvaluationArguments(), cancellationToken).ConfigureAwait(false);
135135
using var request = new HttpRequestMessage(new HttpMethod(this.Http.Method), uri) { Content = requestContent };
136136
using var response = await this.HttpClient.SendAsync(request, cancellationToken).ConfigureAwait(false);
137137
if (!response.IsSuccessStatusCode) //todo: could be configurable on HTTP call?

src/runner/Synapse.Runner/Services/Executors/OpenApiCallExecutor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ protected override async Task DoInitializeAsync(CancellationToken cancellationTo
110110
using var httpClient = this.HttpClientFactory.CreateClient();
111111
await httpClient.ConfigureAuthenticationAsync(this.Task.Workflow.Definition, this.OpenApi.Document.Endpoint.Authentication, this.ServiceProvider, cancellationToken).ConfigureAwait(false);
112112
var uri = StringFormatter.NamedFormat(this.OpenApi.Document.EndpointUri.OriginalString, this.Task.Input.ToDictionary());
113-
if (uri.IsRuntimeExpression()) uri = await this.Task.Workflow.Expressions.EvaluateAsync<string>(uri, this.Task.Input, this.Task.Arguments, cancellationToken).ConfigureAwait(false);
113+
if (uri.IsRuntimeExpression()) uri = await this.Task.Workflow.Expressions.EvaluateAsync<string>(uri, this.Task.Input, this.GetExpressionEvaluationArguments(), cancellationToken).ConfigureAwait(false);
114114
using var request = new HttpRequestMessage(HttpMethod.Get, uri);
115115
using var response = await httpClient.SendAsync(request, cancellationToken).ConfigureAwait(false);
116116
if (!response.IsSuccessStatusCode)

0 commit comments

Comments
 (0)