File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
src/main/kotlin/no/nav/security/mock/oauth2/debugger Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ val assertjVersion = "3.27.4"
66val kotlinLoggingVersion = " 3.0.5"
77val logbackVersion = " 1.5.18"
88val nimbusSdkVersion = " 11.28"
9- val mockWebServerVersion = " 4.12 .0"
9+ val mockWebServerVersion = " 5.1 .0"
1010val jacksonVersion = " 2.20.0"
1111val nettyVersion = " 4.2.5.Final"
1212val junitJupiterVersion = " 5.13.4"
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import okhttp3.MediaType.Companion.toMediaType
1010import okhttp3.OkHttpClient
1111import okhttp3.Request
1212import okhttp3.RequestBody.Companion.toRequestBody
13- import okhttp3.internal.toHostHeader
1413import java.net.URLEncoder
1514import java.nio.charset.StandardCharsets
1615import javax.net.ssl.SSLContext
@@ -44,6 +43,15 @@ internal class TokenRequest(
4443 } +
4544 " \n\n $body "
4645
46+ private fun HttpUrl.toHostHeader (includeDefaultPort : Boolean = false): String {
47+ val host = if (" :" in host) " [$host ]" else host
48+ return if (includeDefaultPort || port != HttpUrl .defaultPort(scheme)) {
49+ " $host :$port "
50+ } else {
51+ host
52+ }
53+ }
54+
4755 private fun Map <String , String >.toKeyValueString (entrySeparator : String ): String =
4856 this
4957 .map { " ${it.key} =${it.value} " }
You can’t perform that action at this time.
0 commit comments