gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated: Testing /admin/add-incoming with defla


From: gnunet
Subject: [libeufin] branch master updated: Testing /admin/add-incoming with deflated request.
Date: Tue, 26 Sep 2023 22:49:38 +0200

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new b0a29536 Testing /admin/add-incoming with deflated request.
b0a29536 is described below

commit b0a2953609cb0303ea7d071296e87e6e62834112
Author: MS <ms@taler.net>
AuthorDate: Tue Sep 26 22:49:11 2023 +0200

    Testing /admin/add-incoming with deflated request.
---
 bank/src/main/kotlin/tech/libeufin/bank/Main.kt |  1 +
 bank/src/test/kotlin/Common.kt                  | 11 ++++++++++-
 bank/src/test/kotlin/TalerApiTest.kt            |  5 +++--
 contrib/wallet-core                             |  2 +-
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/bank/src/main/kotlin/tech/libeufin/bank/Main.kt 
b/bank/src/main/kotlin/tech/libeufin/bank/Main.kt
index b0d9d02c..eb88d15d 100644
--- a/bank/src/main/kotlin/tech/libeufin/bank/Main.kt
+++ b/bank/src/main/kotlin/tech/libeufin/bank/Main.kt
@@ -181,6 +181,7 @@ val corebankDecompressionPlugin = 
createApplicationPlugin("RequestingBodyDecompr
     onCallReceive { call ->
         transformBody { data ->
             if (call.request.headers[HttpHeaders.ContentEncoding] == 
"deflate") {
+                logger.debug("Inflating request..")
                 val brc = try {
                     withContext(Dispatchers.IO) {
                         val inflated = 
InflaterInputStream(data.toInputStream())
diff --git a/bank/src/test/kotlin/Common.kt b/bank/src/test/kotlin/Common.kt
index 29fd01c0..425cff3a 100644
--- a/bank/src/test/kotlin/Common.kt
+++ b/bank/src/test/kotlin/Common.kt
@@ -18,7 +18,8 @@
  */
 
 import tech.libeufin.bank.*
-import tech.libeufin.util.execCommand
+import java.io.ByteArrayOutputStream
+import java.util.zip.DeflaterOutputStream
 
 /**
  * Init the database and sets the currency to KUDOS.
@@ -47,4 +48,12 @@ fun getTestContext(
         suggestedWithdrawalExchange = suggestedExchange,
         spaCaptchaURL = null,
     )
+}
+
+fun deflater(reqBody: String): ByteArray {
+    val bos = ByteArrayOutputStream()
+    val ios = DeflaterOutputStream(bos)
+    ios.write(reqBody.toByteArray())
+    ios.finish()
+    return bos.toByteArray()
 }
\ No newline at end of file
diff --git a/bank/src/test/kotlin/TalerApiTest.kt 
b/bank/src/test/kotlin/TalerApiTest.kt
index 61071327..8bdcc283 100644
--- a/bank/src/test/kotlin/TalerApiTest.kt
+++ b/bank/src/test/kotlin/TalerApiTest.kt
@@ -180,12 +180,13 @@ class TalerApiTest {
                 expectSuccess = true
                 contentType(ContentType.Application.Json)
                 basicAuth("foo", "pw")
-                setBody("""
+                headers.set("Content-Encoding", "deflate")
+                setBody(deflater("""
                     {"amount": "KUDOS:44",
                      "reserve_pub": "RESERVE-PUB-TEST",
                       "debit_account": "BAR-IBAN-ABC"
                       }
-                """.trimIndent())
+                """.trimIndent()))
             }
         }
     }
diff --git a/contrib/wallet-core b/contrib/wallet-core
index 8a9eea81..c5a3cd4c 160000
--- a/contrib/wallet-core
+++ b/contrib/wallet-core
@@ -1 +1 @@
-Subproject commit 8a9eea812bd17a54fa63b5450d0c9e562700589a
+Subproject commit c5a3cd4c50676c49fa6c67cbdeb609101c38e764

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]