-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue : creating response using .WithBody(Func<RequestMessage, string>...) and .WithStatusCode #198
Comments
Do you have multiple mappings defined, or just this one? In case you have multiple, it could be that another mapping does match better than this one. |
I tried it both ways. The number of mappings has no effect. |
My crude fix was to change ProvideResponseAsync in Response.cs:
I doubt very much this is the right fix, but it does set the code properly. |
This is indeed a bug. Thanks for reporting. I'll investigate and fix this. |
Thanks! |
Issue is solved, I created a PR , take a look here: You can review but probably not approve this PR? |
I can review, but it's not a binding approve. Looks good though! |
If I set up a response using both .WithBody and .WithStatusCode, it always returns a status code of 200. For example:
will return the error message but with a 200 status.
It looks like the root cause is that the response callback is creating a new response instead of using the one that was configured.
The text was updated successfully, but these errors were encountered: