Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: reformat #1077

Merged
merged 1 commit into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions cohttp-async/src/server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ type response_action =
| `Response of response ]

type 'r respond_t =
?headers:Http.Header.t ->
?body:Body.t ->
Http.Status.t ->
'r Deferred.t
?headers:Http.Header.t -> ?body:Body.t -> Http.Status.t -> 'r Deferred.t

let close t = Tcp.Server.close t.server
let close_finished t = Tcp.Server.close_finished t.server
Expand Down Expand Up @@ -127,8 +124,7 @@ let resolve_local_file ~docroot ~uri =

let error_body_default = "<html><body><h1>404 Not Found</h1></body></html>"

let respond_with_file ?headers ?(error_body = error_body_default)
filename =
let respond_with_file ?headers ?(error_body = error_body_default) filename =
Monitor.try_with ~run:`Now (fun () ->
Reader.open_file filename >>= fun rd ->
let body = `Pipe (Reader.pipe rd) in
Expand Down
1 change: 0 additions & 1 deletion cohttp/src/s.ml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ module type Response = sig
val headers : t -> Header.t
val version : t -> Code.version
val status : t -> Code.status_code

val compare : t -> t -> int

val make :
Expand Down
12 changes: 6 additions & 6 deletions cohttp/src/server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ module type S = sig
body:body ->
unit ->
response IO.t
(** [respond ?headers ~status ~body] will respond to an HTTP request
with the given [status] code and response [body]. The transfer encoding
will be detected from the [body] value and set to chunked encoding if it
cannot be determined immediately. You can override the encoding by
supplying an appropriate [Content-length] or [Transfer-encoding] in the
[headers] parameter. *)
(** [respond ?headers ~status ~body] will respond to an HTTP request with the
given [status] code and response [body]. The transfer encoding will be
detected from the [body] value and set to chunked encoding if it cannot be
determined immediately. You can override the encoding by supplying an
appropriate [Content-length] or [Transfer-encoding] in the [headers]
parameter. *)

val respond_string :
?headers:Http.Header.t ->
Expand Down
Loading