feat: webfingerにログを追加

This commit is contained in:
usbharu 2023-03-24 17:05:44 +09:00
parent d77d5c77b0
commit 5d989d6827
1 changed files with 3 additions and 3 deletions

View File

@ -46,12 +46,12 @@ fun Application.wellKnown(userService: UserService) {
}
get("/webfinger") {
val uri = call.request.queryParameters["resource"] ?: return@get call.respond(
HttpStatusCode.BadRequest
val uri = call.request.queryParameters["resource"] ?: return@get call.respondText("resource was not found",
status = HttpStatusCode.BadRequest
)
if (uri.startsWith("acct:")) {
return@get call.respond(HttpStatusCode.BadRequest)
return@get call.respondText("$uri was not found.",status =HttpStatusCode.BadRequest)
}
val accountName = uri.substringBeforeLast("@")
val userEntity = userService.findByName(accountName)