feat: acceptを追加

This commit is contained in:
usbharu 2023-03-30 19:47:08 +09:00
parent 7a20b715c3
commit 9db38fc4e0
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
1 changed files with 13 additions and 11 deletions

View File

@ -33,7 +33,9 @@ class WebFingerService(
override suspend fun fetchUserModel(url: String): Person? {
return try {
httpClient.get(url).body<Person>()
httpClient.get(url) {
header("Accept", "application/activity+json")
}.body<Person>()
} catch (e: ResponseException) {
if (e.response.status == HttpStatusCode.NotFound) {
return null