Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ctx.bytes rather than getting the InputStream directly #73

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions cask/src/cask/endpoints/JsonEndpoint.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ class postJson(val path: String, override val subpath: Boolean = false)
val obj = for{
str <-
try {
val boas = new ByteArrayOutputStream()
Util.transferTo(ctx.exchange.getInputStream, boas)
Right(new String(boas.toByteArray))
Right(new String(ctx.bytes))
}
catch{case e: Throwable => Left(cask.model.Response(
"Unable to deserialize input JSON text: " + e + "\n" + Util.stackTraceString(e),
Expand Down