From 0fc097f81fa762630b7dd7e3114e9673174ab01f Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Tue, 17 Dec 2024 13:00:18 +0900 Subject: [PATCH] http (fix): Fix a bug in HttpMultiMap.add() when more than 3 values are added with the same key (#3761) --- .../src/main/scala/wvlet/airframe/http/HttpMultiMap.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airframe-http/src/main/scala/wvlet/airframe/http/HttpMultiMap.scala b/airframe-http/src/main/scala/wvlet/airframe/http/HttpMultiMap.scala index a633832b38..ebe02d3b12 100644 --- a/airframe-http/src/main/scala/wvlet/airframe/http/HttpMultiMap.scala +++ b/airframe-http/src/main/scala/wvlet/airframe/http/HttpMultiMap.scala @@ -105,7 +105,7 @@ case class HttpMultiMap(private val underlying: Map[String, Any] = Map.empty) { .map { entry => val newValue = entry._2 match { case s: String => Seq(s, value) - case lst: Seq[String @unchecked] => lst +: value + case lst: Seq[String @unchecked] => lst :+ value } // Use the already existing key for avoid case-insensitive key duplication underlying + (entry._1 -> newValue)