Skip to content

Commit 41920d5

Browse files
yorlovtipsy
authored andcommitted
Simplify null-handling (tipsy#94)
1 parent 115cfe2 commit 41920d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/app/util/HerokuUtil.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ object HerokuUtil {
1313
fun enableSslRedirect(app: Javalin) {
1414
app.before { ctx ->
1515
if (ctx.header("x-forwarded-proto") == "http") {
16-
val queryString = if (ctx.queryString() != null) "?" + ctx.queryString() else ""
16+
val queryString = ctx.queryString()?.let { query -> "?$query" } ?: ""
1717
ctx.redirect("https://${ctx.header("host")}${ctx.path()}$queryString", 301)
1818
}
1919
}

0 commit comments

Comments
 (0)