Skip to content

Commit

Permalink
use http4s' new Part.filename method
Browse files Browse the repository at this point in the history
this reencodes the filename as UTF-8, which is probably a safe bet.
  • Loading branch information
pschichtel committed Nov 11, 2024
1 parent 7bf16e2 commit d3f452e
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ case class ContentDisposition(dispositionType: String, parameters: Map[CIString,

object ContentDisposition {

def getFileName[F[_]](part: Part[F]): Option[String] =
part.headers.get[ContentDisposition].flatMap(_.parameters.get(ci"filename"))
def getFileName[F[_]](part: Part[F]): Option[String] = part.filename

private[http4s] val mimeValue: Parser[String] = {
val value = Parser.anyChar.repUntilAs[String](Parser.char(';').orElse(Parser.end))
Expand Down

0 comments on commit d3f452e

Please sign in to comment.