Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ val assertjVersion = "3.27.4"
val kotlinLoggingVersion = "3.0.5"
val logbackVersion = "1.5.18"
val nimbusSdkVersion = "11.28"
val mockWebServerVersion = "4.12.0"
val mockWebServerVersion = "5.1.0"
val jacksonVersion = "2.20.0"
val nettyVersion = "4.2.5.Final"
val junitJupiterVersion = "5.13.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.internal.toHostHeader
import java.net.URLEncoder
import java.nio.charset.StandardCharsets
import javax.net.ssl.SSLContext
Expand Down Expand Up @@ -44,6 +43,15 @@ internal class TokenRequest(
} +
"\n\n$body"

private fun HttpUrl.toHostHeader(includeDefaultPort: Boolean = false): String {
val host = if (":" in host) "[$host]" else host
return if (includeDefaultPort || port != HttpUrl.defaultPort(scheme)) {
"$host:$port"
} else {
host
}
}

private fun Map<String, String>.toKeyValueString(entrySeparator: String): String =
this
.map { "${it.key}=${it.value}" }
Expand Down