Skip to content

Commit 3ae77b4

Browse files
authored
Address exception with HTTP proxying (#10616)
* Address exception with HTTP proxying * update release_notes.md * Also set forwarding task instead of add
1 parent 81e301a commit 3ae77b4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

release_notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
-->
66
- Introduced proper handling in environments where .NET in-proc is not supported.
77
- Updated System.Memory.Data reference to 8.0.1
8+
- Address issue with HTTP proxying throwing `ArgumentException` (#10616)

src/WebJobs.Script.Grpc/Server/DefaultHttpProxyService.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,13 @@ public void StartForwarding(ScriptInvocationContext context, Uri httpUri)
8181
}
8282

8383
HttpContext httpContext = httpRequest.HttpContext;
84-
85-
httpContext.Items.Add(ScriptConstants.HttpProxyingEnabled, bool.TrueString);
84+
httpContext.Items[ScriptConstants.HttpProxyingEnabled] = bool.TrueString;
8685

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

9089
var forwardingTask = _httpForwarder.SendAsync(httpContext, httpUri.ToString(), _messageInvoker, _forwarderRequestConfig).AsTask();
91-
context.Properties.Add(ScriptConstants.HttpProxyTask, forwardingTask);
90+
context.Properties[ScriptConstants.HttpProxyTask] = forwardingTask;
9291
}
9392
}
9493
}

0 commit comments

Comments
 (0)