commit f575e615db68461f6533d1af34ba53e46718fb6e
parent b048de329d6201e31cccc543f60c7f0bf1fa0162
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date: Thu, 19 Mar 2020 19:13:10 +0100
change function name
Diffstat:
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
@@ -475,7 +475,7 @@ fun main() {
val subscriber = EbicsSubscriberEntity.findById(subscriberId) ?: throw NexusError(
HttpStatusCode.NotFound, "Subscriber '$subscriberId' not found"
)
- if (accountinfo?.subscriber != subscriber) {
+ if (accountinfo.subscriber != subscriber) {
throw NexusError(HttpStatusCode.BadRequest, "Claimed bank account '$acctid' doesn't belong to subscriber '$subscriberId'!")
}
}
@@ -647,7 +647,7 @@ fun main() {
when (response) {
is EbicsDownloadSuccessResult -> {
call.respondText(
- response.orderData.unzip(),
+ response.orderData.unzipWithLoop(),
ContentType.Text.Plain,
HttpStatusCode.OK
)
@@ -670,7 +670,7 @@ fun main() {
when (response) {
is EbicsDownloadSuccessResult -> {
call.respondText(
- unzipOrderData(response.orderData),
+ response.orderData.unzipWithLoop(),
ContentType.Text.Plain,
HttpStatusCode.OK
)
diff --git a/util/src/main/kotlin/zip.kt b/util/src/main/kotlin/zip.kt
@@ -25,7 +25,7 @@ fun ByteArray.zip(): ByteArray {
return baos.toByteArray()
}
-fun ByteArray.unzip(): String {
+fun ByteArray.unzipWithLoop(): String {
val mem = SeekableInMemoryByteChannel(this)
val zipFile = ZipFile(mem)
val s = java.lang.StringBuilder()