Update baseClient.mustache for scala-http4s (#21825)

The code for setting the form body parameters were wrong,

e.g. the key value pair (id, 12345) would be encoded as
id=%28id%2C12345%29

This commit adds a fix to the base client to correctly setting formBody values the previous pair will now be encoded as

id=12345
This commit is contained in:
Kristian Nedrevold
2025-08-29 07:55:06 +02:00
committed by GitHub
parent afedd3fd33
commit bd0b81d26d
2 changed files with 2 additions and 2 deletions

View File

@@ -66,7 +66,7 @@ abstract class BaseClient[F[*]: Concurrent](
request.putHeaders(Header.Raw(CIString(name), value))
}
val formBody = formParameters.map { x =>
UrlForm(x.groupBy(_._1).map{case (k, v) => (k, v.mkString(","))}.toSeq*)
UrlForm(x.groupBy(_._1).map { case (k, v) => (k, v.map(_._2).mkString(",")) }.toSeq*)
}
import JsonSupports.*

View File

@@ -75,7 +75,7 @@ abstract class BaseClient[F[*]: Concurrent](
request.putHeaders(Header.Raw(CIString(name), value))
}
val formBody = formParameters.map { x =>
UrlForm(x.groupBy(_._1).map{case (k, v) => (k, v.mkString(","))}.toSeq*)
UrlForm(x.groupBy(_._1).map { case (k, v) => (k, v.map(_._2).mkString(",")) }.toSeq*)
}
import JsonSupports.*