diff --git a/src/activities/Elsa.Activities.Http/Activities/Redirect.cs b/src/activities/Elsa.Activities.Http/Activities/Redirect.cs index 30478fffde..d8577ee419 100644 --- a/src/activities/Elsa.Activities.Http/Activities/Redirect.cs +++ b/src/activities/Elsa.Activities.Http/Activities/Redirect.cs @@ -40,13 +40,15 @@ public bool Permanent protected override async Task OnExecuteAsync(WorkflowExecutionContext workflowContext, CancellationToken cancellationToken) { - var response = httpContextAccessor.HttpContext.Response; + var httpContext = httpContextAccessor.HttpContext; + var response = httpContext.Response; if (response.HasStarted) return Fault("Response has already started"); var location = await workflowContext.EvaluateAsync(Location, cancellationToken); response.Redirect(location, Permanent); + httpContext.Items[WorkflowHttpResult.Instance] = WorkflowHttpResult.Instance; return Done(); } diff --git a/src/activities/Elsa.Activities.Http/WorkflowHttpResult.cs b/src/activities/Elsa.Activities.Http/WorkflowHttpResult.cs index 55b8ecd593..1e47bf239f 100644 --- a/src/activities/Elsa.Activities.Http/WorkflowHttpResult.cs +++ b/src/activities/Elsa.Activities.Http/WorkflowHttpResult.cs @@ -2,6 +2,6 @@ namespace Elsa.Activities.Http { public class WorkflowHttpResult { - public static readonly WorkflowHttpResult Instance = new WorkflowHttpResult(); + public static readonly WorkflowHttpResult Instance = new(); } } \ No newline at end of file