Skip to content

Commit

Permalink
chore: log fetchStatement returned
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderPostma committed Nov 5, 2024
1 parent 287e36c commit c79dcb7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ androidx-test-junit = "1.1.5"
compose-plugin = "1.6.10"
junit = "4.13.2"
kotlin = "2.0.0"
ktor = "2.3.11"
ktor = "2.3.12"
kotlinxSerialization = "1.7.1"
kotlinxCoroutines = "1.8.0"
springboot = "3.3.1"
Expand Down Expand Up @@ -84,4 +84,4 @@ kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
springboot = { id = "org.springframework.boot", version.ref = "springboot" }
springDependencyManagement = { id = "io.spring.dependency-management", version.ref = "springDependencyManagement" }
kotlinPluginSpring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" }
kotlinPluginSpring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" }
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.sphereon.oid.fed.client.fetch

import com.sphereon.oid.fed.client.crypto.AbstractCryptoService
import com.sphereon.oid.fed.client.crypto.CryptoConst
import com.sphereon.oid.fed.client.service.DefaultCallbacks
import com.sphereon.oid.fed.client.trustchain.TrustChainConst
import io.ktor.client.HttpClient
import io.ktor.client.call.body
import io.ktor.client.engine.js.Js
Expand Down Expand Up @@ -58,8 +60,11 @@ class FetchServiceJSAdapter(val fetchCallbackJS: FetchServiceJS = FetchServiceJS

override fun platform(): IFetchCallbackServiceJS = fetchCallbackJS.platformCallback

override suspend fun fetchStatement(endpoint: String): String =
this.platformCallback.fetchStatement(endpoint).await()
override suspend fun fetchStatement(endpoint: String): String {
val result = this.platformCallback.fetchStatement(endpoint).await()
TrustChainConst.LOG.info("fetchStatement returned ${result}")
return result
}

override suspend fun getHttpClient(): HttpClient = this.platformCallback.getHttpClient().await()
}
Expand Down Expand Up @@ -92,7 +97,7 @@ class DefaultFetchJSImpl : IFetchCallbackServiceJS {
return@async getHttpClient().await().get(endpoint) {
headers {
append(HttpHeaders.Accept, "application/entity-statement+jwt")
append(HttpHeaders.AcceptCharset, "ascii, utf-8")
append(HttpHeaders.AcceptCharset, "iso-8859-1, us-ascii, utf-8")
}
}.body() as String
}.asPromise()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DefaultFetchJvmImpl : IFetchCallbackService {
return getHttpClient().get(endpoint) {
headers {
append(HttpHeaders.Accept, "application/entity-statement+jwt")
append(HttpHeaders.AcceptCharset, "ascii, utf-8")
append(HttpHeaders.AcceptCharset, "iso-8859-1, us-ascii, utf-8")
}
}.body() as String
}
Expand Down

0 comments on commit c79dcb7

Please sign in to comment.