[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: fix proxied URL construction
From: |
gnunet |
Subject: |
[libeufin] branch master updated: fix proxied URL construction |
Date: |
Sat, 20 Nov 2021 21:08:34 +0100 |
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 d08bb39e fix proxied URL construction
d08bb39e is described below
commit d08bb39e5fa97340c25297c8b6853a6ef34f8f07
Author: ms <ms@taler.net>
AuthorDate: Sat Nov 20 21:07:13 2021 +0100
fix proxied URL construction
---
sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 4 ++--
util/src/main/kotlin/HTTP.kt | 2 +-
util/src/main/kotlin/Payto.kt | 2 +-
util/src/main/kotlin/UnixDomainSocket.kt | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index 77467916..04c99eba 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -423,7 +423,7 @@ suspend inline fun <reified T : Any>
ApplicationCall.receiveJson(): T {
val singleThreadContext = newSingleThreadContext("DB")
val sandboxApp: Application.() -> Unit = {
- install(io.ktor.features.CallLogging) {
+ install(CallLogging) {
this.level = org.slf4j.event.Level.DEBUG
this.logger = logger
}
@@ -1013,7 +1013,6 @@ val sandboxApp: Application.() -> Unit = {
}
// Talk to wallets.
route("/integration-api") {
-
get("/config") {
val demobank = ensureDemobank(call)
call.respond(object {
@@ -1149,6 +1148,7 @@ val sandboxApp: Application.() -> Unit = {
":${baseUrl.port}"
else ""
),
+ baseUrl.path, // has x-forwarded-prefix, or single
slash.
"demobanks",
demobank.name,
"integration-api",
diff --git a/util/src/main/kotlin/HTTP.kt b/util/src/main/kotlin/HTTP.kt
index 26982601..f704f250 100644
--- a/util/src/main/kotlin/HTTP.kt
+++ b/util/src/main/kotlin/HTTP.kt
@@ -145,7 +145,7 @@ fun getAuthorizationHeader(request: ApplicationRequest):
String {
val authorization = request.headers["Authorization"]
logger.debug("Found Authorization header: $authorization")
return authorization ?: throw UtilError(
- HttpStatusCode.BadRequest, "Authorization header not found",
+ HttpStatusCode.Unauthorized, "Authorization header not found",
LibeufinErrorCode.LIBEUFIN_EC_AUTHENTICATION_FAILED
)
}
diff --git a/util/src/main/kotlin/Payto.kt b/util/src/main/kotlin/Payto.kt
index dcf9c874..4c3efb41 100644
--- a/util/src/main/kotlin/Payto.kt
+++ b/util/src/main/kotlin/Payto.kt
@@ -50,7 +50,7 @@ fun parsePayto(paytoLine: String): Payto {
}
val splitPath = javaParsedUri.path.split("/").filter { it.isNotEmpty() }
if (splitPath.size > 2) {
- throw InvalidPaytoError("too many path segments in iban payto URI")
+ throw InvalidPaytoError("too many path segments in iban payto URI:
$paytoLine")
}
val (iban, bic) = if (splitPath.size == 1) {
Pair(splitPath[0], null)
diff --git a/util/src/main/kotlin/UnixDomainSocket.kt
b/util/src/main/kotlin/UnixDomainSocket.kt
index aaea0a8a..0bcedb8b 100644
--- a/util/src/main/kotlin/UnixDomainSocket.kt
+++ b/util/src/main/kotlin/UnixDomainSocket.kt
@@ -56,7 +56,7 @@ class LibeufinHttpInit(
) : ChannelInitializer<Channel>() {
override fun initChannel(ch: Channel) {
ch.pipeline(
- ).addLast(LoggingHandler("tech.libeufin.util")
+ ).addLast(LoggingHandler("tech.libeufin.dev")
).addLast(HttpServerCodec() // in- and out- bound
).addLast(HttpObjectAggregator(Int.MAX_VALUE) // only in- bound
).addLast(ChunkedWriteHandler()
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: fix proxied URL construction,
gnunet <=