From 9d8ade44e4afe5718cb5158c0931cb1cab66ca18 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Fri, 26 Nov 2021 23:27:41 +0800 Subject: [PATCH] Add httpContentType to inputStreamReadable (#35) * Add httpContentType to inputStreamReadable Since InputStreams manage binary data, we can default it to `application/octet-stream` the same as `Array[Byte]`s or `ByteBuffer`s * Update geny/src/geny/Writable.scala Co-authored-by: Lorenzo Gabriele --- geny/src/geny/Writable.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/geny/src/geny/Writable.scala b/geny/src/geny/Writable.scala index c5d9266..248c3bf 100644 --- a/geny/src/geny/Writable.scala +++ b/geny/src/geny/Writable.scala @@ -134,5 +134,6 @@ object Readable{ implicit class InputStreamReadable(i: InputStream) extends Readable{ def readBytesThrough[T](f: InputStream => T): T = f(i) + override def httpContentType: Option[String] = Some("application/octet-stream") } }