From 3b52c03c6588328f1dc01e930aae953c87b70464 Mon Sep 17 00:00:00 2001 From: gagarin55 Date: Tue, 19 Jul 2016 13:24:44 +0300 Subject: [PATCH] POST /waves/address refactored to use postJsonRoute --- src/main/scala/scorex/waves/http/WavesApiRoute.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/scala/scorex/waves/http/WavesApiRoute.scala b/src/main/scala/scorex/waves/http/WavesApiRoute.scala index 9c24c584d7e..b0f43b80338 100644 --- a/src/main/scala/scorex/waves/http/WavesApiRoute.scala +++ b/src/main/scala/scorex/waves/http/WavesApiRoute.scala @@ -225,8 +225,10 @@ case class WavesApiRoute(override val application: Application)(implicit val con path("address") { withCors { entity(as[String]) { publicKey => - val addressFromPubKey = Account.fromPublicKey(Base58.decode(publicKey).get) - complete(HttpEntity(ContentTypes.`application/json`, Json.obj("address" -> addressFromPubKey).toString)) + postJsonRoute { + val addressFromPubKey = Account.fromPublicKey(Base58.decode(publicKey).get) + JsonResponse(Json.obj("address" -> addressFromPubKey), StatusCodes.OK) + } } } }