Skip to content

Commit

Permalink
chore: reformat (#1077)
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterDA authored Jul 20, 2024
1 parent abcad4c commit 059cca0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
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

0 comments on commit 059cca0

Please sign in to comment.