diff --git a/src/Giraffe/Core.fs b/src/Giraffe/Core.fs index 765d11c0..35c8afb8 100644 --- a/src/Giraffe/Core.fs +++ b/src/Giraffe/Core.fs @@ -503,8 +503,7 @@ module Core = /// The string value to be send back to the client. /// A Giraffe function which can be composed into a bigger web application. let setBodyFromString (str: string) : HttpHandler = - let bytes = Encoding.UTF8.GetBytes str - fun (_: HttpFunc) (ctx: HttpContext) -> ctx.WriteBytesAsync bytes + fun (_: HttpFunc) (ctx: HttpContext) -> ctx.WriteStringAsync str /// /// Writes an UTF-8 encoded string to the body of the HTTP response and sets the HTTP Content-Length header accordingly, as well as the Content-Type header to text/plain.