Skip to content

Commit

Permalink
Release:
Browse files Browse the repository at this point in the history
Fix: Trim whitespaces in HTTP parameters

Signed-off-by: Gopal S Akshintala <[email protected]>
  • Loading branch information
overfullstack committed Jan 31, 2025
1 parent 5fce440 commit 405be39
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ endif::[]
:pmtemplates: src/integrationTest/resources/pm-templates
:imagesdir: docs/images
:prewrap!:
:revoman-version: 0.5.4
:revoman-version: 0.5.5

'''

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
* ************************************************************************************************
*/
const val GROUP_ID = "com.salesforce.revoman"
const val VERSION = "0.5.4"
const val VERSION = "0.5.5"
const val ARTIFACT_ID = "revoman"
const val STAGING_PROFILE_ID = "1ea0a23e61ba7d"
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.salesforce.revoman.output.report.Step
import com.salesforce.revoman.output.report.TxnInfo
import com.salesforce.revoman.output.report.failure.RequestFailure.HttpRequestFailure
import org.http4k.client.ApacheClient
import org.http4k.client.PreCannedApacheHttpClients
import org.http4k.client.PreCannedApacheHttpClients.insecureApacheHttpClient
import org.http4k.core.Filter
import org.http4k.core.HttpHandler
import org.http4k.core.NoOp
Expand Down Expand Up @@ -43,6 +43,6 @@ private fun prepareHttpClient(bearerToken: String?, insecureHttp: Boolean): Http
DebuggingFilters.PrintRequestAndResponse()
.then(if (bearerToken.isNullOrEmpty()) Filter.NoOp else ClientFilters.BearerAuth(bearerToken))
.then(
if (insecureHttp) ApacheClient(client = PreCannedApacheHttpClients.insecureApacheHttpClient())
if (insecureHttp) ApacheClient(client = insecureApacheHttpClient())
else ApacheClient()
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import com.salesforce.revoman.internal.postman.PostmanSDK
import com.squareup.moshi.JsonClass
import org.http4k.core.ContentType
import org.http4k.core.ContentType.Companion.APPLICATION_JSON
import org.http4k.core.ContentType.Companion.Text
import org.http4k.core.Method
import org.http4k.core.Uri
import org.http4k.core.queryParametersEncoded
Expand Down Expand Up @@ -55,13 +56,13 @@ data class Request(
header
.firstOrNull { it.key.equals(CONTENT_TYPE.meta.name, ignoreCase = true) }
?.value
?.let { ContentType.Text(it) } ?: APPLICATION_JSON
val uri = Uri.of(url.raw).queryParametersEncoded()
?.let { Text(it) } ?: APPLICATION_JSON
val uri = Uri.of(url.raw.trim()).queryParametersEncoded()
return org.http4k.core
.Request(Method.valueOf(method), uri)
.with(CONTENT_TYPE of contentType)
.headers(header.map { it.key to it.value })
.body(body?.raw ?: "")
.headers(header.map { it.key.trim() to it.value.trim() })
.body(body?.raw?.trim() ?: "")
}

internal fun toPMSDKRequest(pm: PostmanSDK): PostmanSDK.Request = pm.from(this)
Expand Down

0 comments on commit 405be39

Please sign in to comment.