aboutsummaryrefslogtreecommitdiff
path: root/async-http-client-backend
diff options
context:
space:
mode:
authoradamw <adam@warski.org>2017-11-13 15:39:31 +0100
committeradamw <adam@warski.org>2017-11-13 15:39:31 +0100
commitd7d26fbda8559adad2737c2df73076f002c194f9 (patch)
tree04ff4bfa0b9d0806c32f20033f6c8536cf47a260 /async-http-client-backend
parenta0fdfa6f6114aec289e46c4261522244b160e522 (diff)
downloadsttp-d7d26fbda8559adad2737c2df73076f002c194f9.tar.gz
sttp-d7d26fbda8559adad2737c2df73076f002c194f9.tar.bz2
sttp-d7d26fbda8559adad2737c2df73076f002c194f9.zip
#44: supporting type conversion in the backend stub
Diffstat (limited to 'async-http-client-backend')
-rw-r--r--async-http-client-backend/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientBackend.scala4
1 files changed, 1 insertions, 3 deletions
diff --git a/async-http-client-backend/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientBackend.scala b/async-http-client-backend/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientBackend.scala
index a19dc1a..ddf5570 100644
--- a/async-http-client-backend/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientBackend.scala
+++ b/async-http-client-backend/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientBackend.scala
@@ -223,9 +223,7 @@ abstract class AsyncHttpClientBackend[R[_], S](asyncHttpClient: AsyncHttpClient,
case InputStreamBody(b, _) =>
// sadly async http client only supports parts that are strings,
// byte arrays or files
- val baos = new ByteArrayOutputStream()
- transfer(b, baos)
- new ByteArrayPart(nameWithFilename, baos.toByteArray)
+ new ByteArrayPart(nameWithFilename, toByteArray(b))
case PathBody(b, _) =>
new FilePart(mp.name, b.toFile, null, null, mp.fileName.orNull)
}