libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit b435de4b9db0acaf447fe3795fa0947e6a78fd39
parent 220679f6b759794d2846a7b8d4e7aea9b7c9e781
Author: ms <ms@taler.net>
Date:   Tue, 19 Apr 2022 18:16:17 +0200

prefer dropping the /lang part

Diffstat:
Msandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 13++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt @@ -957,10 +957,21 @@ val sandboxApp: Application.() -> Unit = { } /** + * Requests falling here may only be generated by links + * defined after the Python bank. This redirect is a workaround + * to avoid 404. + */ + get("/demobanks/{demobankid}/{lang?}/{register?}") { + val demobankId = ensureNonNull(call.parameters["demobankid"]) + var url = "${call.request.getBaseUrl()}demobanks/$demobankId" + call.respondRedirect(url,true) + return@get + } + /** * 'lang' unused. It works around the /$lang-terminated * links that some shops still have in their demo navigation bar. */ - get("/demobanks/{demobankid}/{lang?}/") { + get("/demobanks/{demobankid}") { val demobank = ensureDemobank(call) /**