Skip to content

Commit

Permalink
fix: case-insensitive FormField headers (#2460)
Browse files Browse the repository at this point in the history
* fix: case-insensitive FormField headers

* use equalsIgnoreCase

* fix: imports

* fix: imports2
  • Loading branch information
jgranstrom authored Sep 27, 2023
1 parent 588ab4f commit 5906d30
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.equalsIgnoreCase("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.equalsIgnoreCase("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.equalsIgnoreCase("Content-Transfer-Encoding") =>
(accum._1, accum._2, Some(header), accum._4)
case (accum, _) => accum
case (accum, _) => accum
}

for {
Expand Down

0 comments on commit 5906d30

Please sign in to comment.