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"
6
6
val kotlinLoggingVersion = " 3.0.5"
7
7
val logbackVersion = " 1.5.18"
8
8
val nimbusSdkVersion = " 11.28"
9
- val mockWebServerVersion = " 4.12 .0"
9
+ val mockWebServerVersion = " 5.1 .0"
10
10
val jacksonVersion = " 2.20.0"
11
11
val nettyVersion = " 4.2.5.Final"
12
12
val junitJupiterVersion = " 5.13.4"
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import okhttp3.MediaType.Companion.toMediaType
10
10
import okhttp3.OkHttpClient
11
11
import okhttp3.Request
12
12
import okhttp3.RequestBody.Companion.toRequestBody
13
- import okhttp3.internal.toHostHeader
14
13
import java.net.URLEncoder
15
14
import java.nio.charset.StandardCharsets
16
15
import javax.net.ssl.SSLContext
@@ -44,6 +43,15 @@ internal class TokenRequest(
44
43
} +
45
44
" \n\n $body "
46
45
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
+
47
55
private fun Map <String , String >.toKeyValueString (entrySeparator : String ): String =
48
56
this
49
57
.map { " ${it.key} =${it.value} " }
You can’t perform that action at this time.
0 commit comments