feat: acceptを追加

This commit is contained in:
usbharu 2023-03-30 19:47:08 +09:00
parent e97a3e9e96
commit 5320915f7f
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