Skip to content

Commit

Permalink
Fixing InvalidOperationException when using responseWrite scripting m…
Browse files Browse the repository at this point in the history
…ethod (#12213)

Co-authored-by: Zoltán Lehóczky <zoltan.lehoczky@lombiq.com>
  • Loading branch information
lampersky and Piedone committed Apr 21, 2024
1 parent 5db4793 commit eb43940
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ public HttpMethodsProvider(IHttpContextAccessor httpContextAccessor)
_responseWriteMethod = new GlobalMethod
{
Name = "responseWrite",
Method = serviceProvider => (Action<string>)(text => httpContextAccessor.HttpContext.Response.WriteAsync(text).GetAwaiter().GetResult()),
Method = serviceProvider => (Action<string>)(text => {
httpContextAccessor.HttpContext.Items[WorkflowHttpResult.Instance] = WorkflowHttpResult.Instance;
httpContextAccessor.HttpContext.Response.WriteAsync(text).GetAwaiter().GetResult();
})
};

_absoluteUrlMethod = new GlobalMethod
Expand Down

0 comments on commit eb43940

Please sign in to comment.