Sends Accept and Content-Type to the NIP86 request

This commit is contained in:
Vitor Pamplona
2026-03-28 19:23:48 -04:00
parent 7290f16d0d
commit 14ff2fbf8c
2 changed files with 3 additions and 2 deletions
@@ -54,6 +54,7 @@ class Nip86Retriever(
.Builder()
.url(client.httpUrl)
.header("Content-Type", "application/nostr+json+rpc")
.header("Accept", "application/nostr+json+rpc")
.header("Authorization", authToken)
.post(bodyBytes.toRequestBody(CONTENT_TYPE))
.build()
@@ -73,7 +74,7 @@ class Nip86Retriever(
client.parseResponse(body)
} catch (e: Exception) {
if (e is CancellationException) throw e
Log.e("Nip86Retriever", "Failed to parse response: $body", e)
Log.e("Nip86Retriever", "Failed to parse response ${client.httpUrl}: $body", e)
Nip86Response(error = "Failed to parse response: ${e.message}")
}
}
@@ -128,7 +128,7 @@ fun RelayManagementScreen(
remember(relay) {
RelayManagementViewModel(
relayUrl = relay,
signer = accountViewModel.account.signer,
account = accountViewModel.account,
retriever = retriever,
)
}