Skip to content

Commit

Permalink
fix: case-insensitive FormField headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jgranstrom committed Sep 26, 2023
1 parent 4123b17 commit c309428
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions zio-http/src/main/scala/zio/http/FormField.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c309428

Please sign in to comment.