Accept utf-8 in content-type
This commit is contained in:
parent
40e57b68eb
commit
e075e2601b
@ -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")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user