Skip to content

Commit

Permalink
Also set forwarding task instead of add
Browse files Browse the repository at this point in the history
  • Loading branch information
jviau committed Nov 8, 2024
1 parent 257c4e2 commit f5e3d43
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/WebJobs.Script.Grpc/Server/DefaultHttpProxyService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,13 @@ public void StartForwarding(ScriptInvocationContext context, Uri httpUri)
}

HttpContext httpContext = httpRequest.HttpContext;

httpContext.Items[ScriptConstants.HttpProxyingEnabled] = bool.TrueString;

// add invocation id as correlation id
httpRequest.Headers.TryAdd(ScriptConstants.HttpProxyCorrelationHeader, context.ExecutionContext.InvocationId.ToString());

var forwardingTask = _httpForwarder.SendAsync(httpContext, httpUri.ToString(), _messageInvoker, _forwarderRequestConfig).AsTask();
context.Properties.Add(ScriptConstants.HttpProxyTask, forwardingTask);
context.Properties[ScriptConstants.HttpProxyTask] = forwardingTask;
}
}
}

0 comments on commit f5e3d43

Please sign in to comment.