Connections are not closing immediately after coercing the body using transit. This is a regression introduced in https://github.com/dakrone/clj-http/pull/475. Previously, the response body always was also transferred into an intermediate byte-array which will read bytes until the stream is empty, and automatically close the connection.
Since we no longer have this implicit behavior, the body coercion middleware must close the inputstream after reading a value.
Fixes #564
Testing Notes
REPL Output showing connection closing after the change:
Connections are not closing immediately after coercing the body using transit. This is a regression introduced in https://github.com/dakrone/clj-http/pull/475. Previously, the response body always was also transferred into an intermediate byte-array which will read bytes until the stream is empty, and automatically close the connection.
Since we no longer have this implicit behavior, the body coercion middleware must close the inputstream after reading a value.
Fixes #564
Testing Notes
REPL Output showing connection closing after the change: