Skip to content

Commit

Permalink
add leaveOpen=true to ReadBodyFromRequestAsync, so the ctx.Request.Bo…
Browse files Browse the repository at this point in the history
…dy is not disposed
  • Loading branch information
64J0 committed Sep 6, 2024
1 parent a5d7072 commit 21ded48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Giraffe/HttpContextExtensions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ type HttpContextExtensions() =
[<Extension>]
static member ReadBodyFromRequestAsync(ctx: HttpContext) =
task {
use reader = new StreamReader(ctx.Request.Body, Encoding.UTF8)
use reader = new StreamReader(ctx.Request.Body, Encoding.UTF8, leaveOpen = true)
return! reader.ReadToEndAsync()
}

Expand Down

0 comments on commit 21ded48

Please sign in to comment.