mirror of https://github.com/usbharu/Hideout.git
refactor: HttpSignatureSignerImplをリファクタリング
This commit is contained in:
parent
c3233965c6
commit
4e132d3b64
|
@ -55,13 +55,13 @@ class HttpSignatureSignerImpl : HttpSignatureSigner {
|
||||||
signHeaders: List<String>
|
signHeaders: List<String>
|
||||||
): String {
|
): String {
|
||||||
headers.toMap().map { it.key.lowercase() to it.value }.toMap()
|
headers.toMap().map { it.key.lowercase() to it.value }.toMap()
|
||||||
val result = signHeaders.map {
|
val result = signHeaders.joinToString("\n") {
|
||||||
if (it.startsWith("(")) {
|
if (it.startsWith("(")) {
|
||||||
specialHeader(it, url, method)
|
specialHeader(it, url, method)
|
||||||
} else {
|
} else {
|
||||||
generalHeader(it, headers.get(it)!!)
|
generalHeader(it, headers.get(it)!!)
|
||||||
}
|
}
|
||||||
}.joinToString("\n")
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue