From 6df3c1a670599a3748ac0fe5c094c75480c16b4a Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Fri, 31 Mar 2023 17:17:45 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Digest=E3=82=92hex=E3=81=8B=E3=82=89bas?= =?UTF-8?q?e64=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/dev/usbharu/hideout/plugins/ActivityPub.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/plugins/ActivityPub.kt b/src/main/kotlin/dev/usbharu/hideout/plugins/ActivityPub.kt index 46e61062..ed0eb615 100644 --- a/src/main/kotlin/dev/usbharu/hideout/plugins/ActivityPub.kt +++ b/src/main/kotlin/dev/usbharu/hideout/plugins/ActivityPub.kt @@ -61,8 +61,9 @@ val httpSignaturePlugin = createClientPlugin("HttpSign", ::HttpSignaturePluginCo if (request.bodyType?.type == String::class) { println(body as String) println("Digest !!") +// UserAuthService.sha256.reset() val digest = - hex(UserAuthService.sha256.digest((body as String).toByteArray(Charsets.UTF_8))) + Base64.getEncoder().encodeToString(UserAuthService.sha256.digest(body.toByteArray(Charsets.UTF_8))) request.headers.append("Digest", "sha-256="+digest) }