From c309428514074a22a7c85df1a920f8ee2ee030ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Granstr=C3=B6m?= Date: Tue, 26 Sep 2023 16:21:06 +0200 Subject: [PATCH] fix: case-insensitive FormField headers --- zio-http/src/main/scala/zio/http/FormField.scala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zio-http/src/main/scala/zio/http/FormField.scala b/zio-http/src/main/scala/zio/http/FormField.scala index 41bd786337..a3a181e3e9 100644 --- a/zio-http/src/main/scala/zio/http/FormField.scala +++ b/zio-http/src/main/scala/zio/http/FormField.scala @@ -155,15 +155,15 @@ object FormField { Chunk.empty[FormAST.Content], ), ) { - case (accum, header: FormAST.Header) if header.name == "Content-Disposition" => + case (accum, header: FormAST.Header) if header.name.toLowerCase == "content-disposition" => (Some(header), accum._2, accum._3, accum._4) - case (accum, content: FormAST.Content) => + case (accum, content: FormAST.Content) => (accum._1, accum._2, accum._3, accum._4 :+ content) - case (accum, header: FormAST.Header) if header.name == "Content-Type" => + case (accum, header: FormAST.Header) if header.name.toLowerCase == "content-type" => (accum._1, Some(header), accum._3, accum._4) - case (accum, header: FormAST.Header) if header.name == "Content-Transfer-Encoding" => + case (accum, header: FormAST.Header) if header.name.toLowerCase == "content-transfer-encoding" => (accum._1, accum._2, Some(header), accum._4) - case (accum, _) => accum + case (accum, _) => accum } for {