Skip to content

Commit 4ec4b55

Browse files
committed
[F] Remove sensitive: keychip and time
1 parent 6460f17 commit 4ec4b55

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/kotlin/FutariLobby.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package aquadx
22

3+
import com.alibaba.fastjson2.parseObject
34
import com.alibaba.fastjson2.toJSONString
45
import io.ktor.server.application.*
56
import io.ktor.server.request.*
@@ -70,7 +71,12 @@ fun Application.configureRouting() = routing {
7071
get("/recruit/list") {
7172
val time = millis()
7273
recruits.filterValues { time - it.Time > MAX_TTL }.keys.forEach { recruits.remove(it) }
73-
call.respondText(recruits.values.toList().joinToString("\n") { KJson.encodeToString(it) })
74+
call.respondText(recruits.values.toList().joinToString("\n") { obj ->
75+
KJson.encodeToString(obj).parseObject().apply {
76+
this.remove("Keychip")
77+
this.remove("Time")
78+
}.toJSONString()
79+
})
7480
}
7581

7682
get("/info") {

0 commit comments

Comments
 (0)