Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Commit

Permalink
check routeresult is Response
Browse files Browse the repository at this point in the history
  • Loading branch information
jchannon committed Jul 26, 2016
1 parent 040f8e6 commit 347a8c0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Nancy/Responses/Negotiation/DefaultResponseNegotiator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ private static bool TryCastResultToResponse(dynamic routeResult, out Response re
var targetType = routeResult.GetType();
var responseType = typeof(Response);

if (routeResult is Response)
{
response = (Response)routeResult;
return true;
}

var methods = responseType.GetMethods(BindingFlags.Public | BindingFlags.Static);

foreach (var method in methods)
Expand Down

0 comments on commit 347a8c0

Please sign in to comment.