Skip to content

Commit 032c252

Browse files
committed
Merge branch 'ktor-deprecation' of https://github.com/rlnt/openapi-generator into rlnt-ktor-deprecation
2 parents b421f5d + 9acac9f commit 032c252

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package {{packageName}}.auth
22

3-
import io.ktor.util.encodeBase64
3+
import kotlin.io.encoding.Base64
44

55
{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class HttpBasicAuth : Authentication {
66
{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var username: String? = null
@@ -9,7 +9,7 @@ import io.ktor.util.encodeBase64
99
override fun apply(query: MutableMap<String, List<String>>, headers: MutableMap<String, String>) {
1010
if (username == null && password == null) return
1111
val str = (username ?: "") + ":" + (password ?: "")
12-
val auth = str.encodeBase64()
12+
val auth = Base64.encode(str.encodeToByteArray())
1313
headers["Authorization"] = "Basic $auth"
1414
}
1515
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package {{packageName}}.auth
22

3-
import io.ktor.util.encodeBase64
3+
import kotlin.io.encoding.Base64
44

55
{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class HttpBasicAuth : Authentication {
66
{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var username: String? = null
@@ -9,7 +9,7 @@ import io.ktor.util.encodeBase64
99
override fun apply(query: MutableMap<String, List<String>>, headers: MutableMap<String, String>) {
1010
if (username == null && password == null) return
1111
val str = (username ?: "") + ":" + (password ?: "")
12-
val auth = str.encodeBase64()
12+
val auth = Base64.encode(str.encodeToByteArray())
1313
headers["Authorization"] = "Basic $auth"
1414
}
1515
}

0 commit comments

Comments
 (0)