mirror of
https://github.com/usbharu/Hideout.git
synced 2026-09-11 19:57:28 +00:00
feat: Hostの署名に対応
This commit is contained in:
@@ -47,7 +47,7 @@ suspend fun HttpClient.postAp(urlString: String, username: String, jsonLd: JsonL
|
|||||||
suspend fun HttpClient.getAp(urlString: String,username: String):HttpResponse {
|
suspend fun HttpClient.getAp(urlString: String,username: String):HttpResponse {
|
||||||
return this.get(urlString){
|
return this.get(urlString){
|
||||||
header("Accept",ContentType.Application.Activity)
|
header("Accept",ContentType.Application.Activity)
|
||||||
header("Signature","keyId=\"$username\",algorithm=\"rsa-sha256\",headers=\"(request-target) date\"")
|
header("Signature","keyId=\"$username\",algorithm=\"rsa-sha256\",headers=\"(request-target) host date\"")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,6 +63,7 @@ val httpSignaturePlugin = createClientPlugin("HttpSign", ::HttpSignaturePluginCo
|
|||||||
|
|
||||||
|
|
||||||
request.header("Date", format.format(Date()))
|
request.header("Date", format.format(Date()))
|
||||||
|
request.header("Host",request.url.host+request.url.port.toString())
|
||||||
println(request.bodyType)
|
println(request.bodyType)
|
||||||
println(request.bodyType?.type)
|
println(request.bodyType?.type)
|
||||||
if (request.bodyType?.type == String::class) {
|
if (request.bodyType?.type == String::class) {
|
||||||
@@ -110,7 +111,9 @@ val httpSignaturePlugin = createClientPlugin("HttpSign", ::HttpSignaturePluginCo
|
|||||||
"date" -> {
|
"date" -> {
|
||||||
"Date"
|
"Date"
|
||||||
}
|
}
|
||||||
|
"host" -> {
|
||||||
|
"Host"
|
||||||
|
}
|
||||||
else -> {
|
else -> {
|
||||||
it
|
it
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user