You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When having a layered architecture that goes through some middleware before reaching the default route, than calling ShouldBindJSON a second time on the same context will fatal crash the app with EOF exception.
How to reproduce
call this twice with a valid model/JSON in a HandlerFunc:
The request body is an io.Reader instance, which typically contains a byte buffer and a read offset. When ShouldBindJSON is called for the first time, it reads the buffer and sets the offset to the end.
Description
When having a layered architecture that goes through some middleware before reaching the default route, than calling ShouldBindJSON a second time on the same context will fatal crash the app with EOF exception.
How to reproduce
call this twice with a valid model/JSON in a HandlerFunc:
Expectations
I can bind the json multiple times to an object
Actual result
some internal reader goes EOF when calling it a second time
Environment
The text was updated successfully, but these errors were encountered: