There was an error while loading. Please reload this page.
1 parent 115cfe2 commit 41920d5Copy full SHA for 41920d5
src/main/kotlin/app/util/HerokuUtil.kt
@@ -13,7 +13,7 @@ object HerokuUtil {
13
fun enableSslRedirect(app: Javalin) {
14
app.before { ctx ->
15
if (ctx.header("x-forwarded-proto") == "http") {
16
- val queryString = if (ctx.queryString() != null) "?" + ctx.queryString() else ""
+ val queryString = ctx.queryString()?.let { query -> "?$query" } ?: ""
17
ctx.redirect("https://${ctx.header("host")}${ctx.path()}$queryString", 301)
18
}
19
0 commit comments