fix User.kt(4x)

- fun enable fix
This commit is contained in:
dalbodeule 2024-08-08 20:41:17 +09:00
parent 81c62d6c55
commit e342a3aabb
No known key found for this signature in database
GPG Key ID: EFA860D069C9FA65
2 changed files with 4 additions and 2 deletions

View File

@ -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
} }
} }

View File

@ -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,