Skip to content

Commit

Permalink
Set the detail instead of the title
Browse files Browse the repository at this point in the history
  • Loading branch information
khellang committed Mar 15, 2021
1 parent c1c92ae commit 5b692a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ProblemDetails/Mvc/ProblemDetailsResultFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public void OnResultExecuting(ResultExecutingContext context)
}

// Only handle the string case for now.
if (result.Value is not string title)
if (result.Value is not string detail)
{
return;
}

var problemDetails = Factory.CreateProblemDetails(context.HttpContext, result.StatusCode, title);
var problemDetails = Factory.CreateProblemDetails(context.HttpContext, result.StatusCode, detail: detail);

context.Result = new ObjectResult(problemDetails)
{
Expand Down

0 comments on commit 5b692a0

Please sign in to comment.