This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Best way to log/read request body in a middleware ? #4962
Comments
@halter73 @CesarBS @Tratcher - do you think this is aspnet/KestrelHttpServer#940 ? What's the workaround for this? |
Thanks @rynowak. |
Edit: oops, did not mean to close 😆 It seems like you might be able to work around the problem like so:
Does that work? |
Yes, thanks again ! Here is the resulting snippet, including the workaround.
|
@IsaacSee Thank a lot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello,
For logging concern we need to read and rewind the request body.
With pre-rc2 we used EnableRewind() to read then rewind the body stream.
But with 1.0.0, it seems that Kestrel uses stream pooling, resulting in ObjectDisposed Exceptions on the following request after calling EnableRewind().
Is there a new way to read the body before MVC [FromBody] ?
Or is this an issue ?
Thanks.
The text was updated successfully, but these errors were encountered: