Closed c-cube closed 1 year ago
So far I have only one change to request here; not sure how to suggest it "in a Git way" but: Tiny_httpd_server.ml
line 397: let make_raw_writer ?(headers = []) ?(code=200) body : t =
(and corresponding exposition in Tiny_httpd_server.mli
so I can use it).
Rationale: all our responses will be created the same way and we will never rely on the library's built-in >300 responses for our generated content. Therefore we don't need a result
wrapper and its dual "writer stream vs plain string" expectation.
I think it's reasonable enough to use Response.make_writer (`Ok w)
, no? :)
I'm not opposed to the useless wrapping in a result
, but I need to be able to set that response code, hence my fiddling with code
in the above.
IO.Writer.t
, a push based stream