From e075e2601b98f35a7588b0886c3e2638d3b4380e Mon Sep 17 00:00:00 2001 From: orbifx Date: Sun, 26 Sep 2021 14:18:43 +0100 Subject: [PATCH] Accept utf-8 in content-type --- http/http.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/http/http.ml b/http/http.ml index 662ceda..c1cfb8b 100644 --- a/http/http.ml +++ b/http/http.ml @@ -7,7 +7,8 @@ let http_body fn uri = let response (headers, body) = let open Cohttp in match Header.get (headers |> Response.headers) "content-type" with - | Some "application/msgpack" | Some "text/plain" | Some "application/octet-stream" -> Ok body + | Some "application/msgpack" | Some "application/octet-stream" + | Some "text/plain" | Some "text/plain; charset=utf-8" -> Ok body | Some x -> Error ("Invalid content-type: " ^ x) | None -> Error ("No content-type")