Skip to content

Commit

Permalink
Specify utf-8 as default form encoding in undertow helper (#138)
Browse files Browse the repository at this point in the history
This makes it possible to parse non-ascii characters in form fields.
  • Loading branch information
jodersky authored Aug 12, 2024
1 parent 080f2f3 commit f337901
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cask/src/cask/endpoints/FormEndpoint.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ class postForm(val path: String, override val subpath: Boolean = false)
def wrapFunction(ctx: Request,
delegate: Delegate): Result[Response.Raw] = {
try {
val formData = FormParserFactory.builder().build().createParser(ctx.exchange).parseBlocking()
val formData = FormParserFactory
.builder().withDefaultCharset("utf-8").build()
.createParser(ctx.exchange)
.parseBlocking()
delegate(
formData
.iterator()
Expand Down

0 comments on commit f337901

Please sign in to comment.