mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-06-09 15:28:21 +00:00
fix User.kt(4x)
- fun enable fix
This commit is contained in:
parent
81c62d6c55
commit
e342a3aabb
@ -129,6 +129,7 @@ val server = embeddedServer(Netty, port = 8080, ) {
|
|||||||
allowMethod(HttpMethod.Get)
|
allowMethod(HttpMethod.Get)
|
||||||
allowHost(dotenv["FRONTEND"] ?: "localhost:3000", schemes=listOf("https"))
|
allowHost(dotenv["FRONTEND"] ?: "localhost:3000", schemes=listOf("https"))
|
||||||
allowCredentials = true
|
allowCredentials = true
|
||||||
|
allowNonSimpleContentTypes = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ data class RegisterChzzkUserDTO(
|
|||||||
)
|
)
|
||||||
|
|
||||||
fun Routing.apiRoutes() {
|
fun Routing.apiRoutes() {
|
||||||
val chzzkIDRegex = """(?:.+chzzk\.naver\.com/)?([a-f0-9]{32})?(?:/live)?${'$'}""".toRegex()
|
val chzzkIDRegex = """(?:.+chzzk\.naver\.com/)?([a-f0-9]{32})?(?:/live)?${'$'}/.+""".toRegex()
|
||||||
val dispatcher: CoroutinesEventBus by inject(CoroutinesEventBus::class.java)
|
val dispatcher: CoroutinesEventBus by inject(CoroutinesEventBus::class.java)
|
||||||
|
|
||||||
route("/") {
|
route("/") {
|
||||||
@ -97,10 +97,11 @@ fun Routing.apiRoutes() {
|
|||||||
|
|
||||||
if(status?.content == null) {
|
if(status?.content == null) {
|
||||||
call.respondText(user.naverId, status = HttpStatusCode.NotFound)
|
call.respondText(user.naverId, status = HttpStatusCode.NotFound)
|
||||||
|
return@get
|
||||||
}
|
}
|
||||||
|
|
||||||
call.respond(HttpStatusCode.OK, GetSessionDTO(
|
call.respond(HttpStatusCode.OK, GetSessionDTO(
|
||||||
status!!.content!!.channel.channelId,
|
status.content!!.channel.channelId,
|
||||||
status.content!!.channel.channelName,
|
status.content!!.channel.channelName,
|
||||||
status.content!!.status == "OPEN",
|
status.content!!.status == "OPEN",
|
||||||
status.content!!.channel.channelImageUrl,
|
status.content!!.channel.channelImageUrl,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user