From 3b2d040519a91d2db9861d37ba34500cf882a063 Mon Sep 17 00:00:00 2001 From: Sunny Chung Date: Wed, 10 Jan 2024 21:39:19 +0800 Subject: [PATCH 1/5] update version to 1.4.5-SNAPSHOT --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 163b3642..52082016 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ plugins { } group = "com.sunnychung.application" -version = "1.4.4" // must be in 'x.y.z' for native distributions +version = "1.4.5-SNAPSHOT" // must be in 'x.y.z' for native distributions repositories { google() From bd5485e554d76bdef9f5d3bd297e7354babca26d Mon Sep 17 00:00:00 2001 From: Sunny Chung Date: Wed, 10 Jan 2024 21:57:11 +0800 Subject: [PATCH 2/5] fix creating a WebSocket request must crash although succeed --- .../application/multiplatform/hellohttp/ux/RequestEditorView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/RequestEditorView.kt b/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/RequestEditorView.kt index f17149ac..2b032201 100644 --- a/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/RequestEditorView.kt +++ b/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/RequestEditorView.kt @@ -138,7 +138,7 @@ fun RequestEditorView( val hasPayloadEditor = (request.application == ProtocolApplication.WebSocket || (request.application == ProtocolApplication.Grpc && currentGrpcMethod?.isClientStreaming == true) ) - var selectedPayloadExampleId by rememberLast(request.id) { mutableStateOf(request.payloadExamples?.firstOrNull()?.id) } + var selectedPayloadExampleId by rememberLast(request.id, request.application) { mutableStateOf(request.payloadExamples?.firstOrNull()?.id) } val isEnableSendButton = when (connectionStatus.isConnectionActive()) { true -> true From 190e8bb83fe8c56d88648257ef1173322d3a90b1 Mon Sep 17 00:00:00 2001 From: Sunny Chung Date: Mon, 29 Jan 2024 20:53:01 +0800 Subject: [PATCH 3/5] fix Unicode characters inside request body could not be sent properly for HTTP text requests --- .../hellohttp/extension/UserRequestConversionExtension.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/extension/UserRequestConversionExtension.kt b/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/extension/UserRequestConversionExtension.kt index ac0e30fd..b08a8cd8 100644 --- a/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/extension/UserRequestConversionExtension.kt +++ b/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/extension/UserRequestConversionExtension.kt @@ -215,7 +215,7 @@ fun HttpRequest.toApacheHttpRequest(): Pair { *(entity.trailers?.get()?.toTypedArray() ?: emptyArray()) ) } - is StringBody -> AsyncEntityProducers.create(body.value) + is StringBody -> AsyncEntityProducers.create(body.value, Charsets.UTF_8) null -> null else -> throw UnsupportedOperationException() } From 054bff9762df34a9f5b11c43cafd65d519426925 Mon Sep 17 00:00:00 2001 From: Sunny Chung Date: Mon, 29 Jan 2024 21:35:04 +0800 Subject: [PATCH 4/5] fix Unicode characters and spaces in URL were not encoded properly (generated curl commands would not contain Unicode in URL now) --- .../application/multiplatform/hellohttp/model/HttpRequest.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/model/HttpRequest.kt b/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/model/HttpRequest.kt index 6531df1f..d81954e6 100644 --- a/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/model/HttpRequest.kt +++ b/src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/model/HttpRequest.kt @@ -14,7 +14,7 @@ data class HttpRequest( val extra: Any? = null ) { fun getResolvedUri(): URI { - return URIBuilder(url) + return URIBuilder(url.replace(" ", "+")) .run { var b = this queryParameters.forEach { @@ -23,5 +23,6 @@ data class HttpRequest( b } .build() + .let { URI.create(it.toASCIIString()) } } } From 78c7c13aa93f0e80571ad7405d587b9cd93b151e Mon Sep 17 00:00:00 2001 From: Sunny Chung Date: Mon, 29 Jan 2024 22:47:25 +0800 Subject: [PATCH 5/5] update version to 1.4.5 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 52082016..c13a78c7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ plugins { } group = "com.sunnychung.application" -version = "1.4.5-SNAPSHOT" // must be in 'x.y.z' for native distributions +version = "1.4.5" // must be in 'x.y.z' for native distributions repositories { google()