Accept absense of HTTP content-type header

This commit is contained in:
orbifx 2021-10-15 00:26:21 +01:00
parent 5b4bdf223b
commit aa3350ec2f

View File

@ -10,7 +10,7 @@ let response (headers, body) =
| Some "application/msgpack" | Some "application/octet-stream" | Some "application/msgpack" | Some "application/octet-stream"
| Some "text/plain" | Some "text/plain; charset=utf-8" -> Ok body | Some "text/plain" | Some "text/plain; charset=utf-8" -> Ok body
| Some x -> Error ("Invalid content-type: " ^ x) | Some x -> Error ("Invalid content-type: " ^ x)
| None -> Error ("No content-type") | None -> Ok body
let http_apply fn uri = Lwt_main.run (http_body fn uri) let http_apply fn uri = Lwt_main.run (http_body fn uri)