Skip to content

Commit

Permalink
Add httpContentType to inputStreamReadable (#35)
Browse files Browse the repository at this point in the history
* 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 <lorenzolespaul@gmail.com>
  • Loading branch information
lihaoyi and lolgab authored Nov 26, 2021
1 parent 046158f commit 9d8ade4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions geny/src/geny/Writable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}

0 comments on commit 9d8ade4

Please sign in to comment.