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

Commit

Permalink
Merge pull request #2516 from jchannon/responsecastfix
Browse files Browse the repository at this point in the history
Check routeresult is Response
  • Loading branch information
grumpydev authored Aug 4, 2016
2 parents d7973f5 + 347a8c0 commit fc9cda6
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 fc9cda6

Please sign in to comment.