Skip to content

Commit

Permalink
Cut request_from_http from dream-pure
Browse files Browse the repository at this point in the history
This completes an initial version of the refactoring mentioned in #8.
  • Loading branch information
aantron committed Dec 14, 2021
1 parent ba859ab commit 8652178
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 34 deletions.
4 changes: 3 additions & 1 deletion src/middleware/server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ let with_https https request =
(* TODO Eventually remove Dream.request_from_http as all of its functionality
is moved here. *)
let request ~client ~method_ ~target ~https ~version ~headers server_stream =
Dream.request_from_http ~method_ ~target ~version ~headers server_stream
(* TODO Use pre-allocated streams. *)
let client_stream = Dream.Stream.(stream no_reader no_writer) in
Dream.request ~method_ ~target ~version ~headers client_stream server_stream
|> with_client client
|> with_https https

Expand Down
10 changes: 0 additions & 10 deletions src/pure/dream_pure.mli
Original file line number Diff line number Diff line change
Expand Up @@ -322,16 +322,6 @@ val is_websocket : response -> (websocket -> unit promise) option



val request_from_http :
method_:method_ ->
target:string ->
version:int * int ->
headers:(string * string) list ->
stream ->
request



module Formats :
sig
val html_escape : string -> string
Expand Down
23 changes: 0 additions & 23 deletions src/pure/inmost.ml
Original file line number Diff line number Diff line change
Expand Up @@ -259,29 +259,6 @@ let with_local key value message =
let fold_locals f initial message =
fold_scope f initial message.locals

let request_from_http
~method_
~target
~version
~headers
body =

let rec request = {
specific = {
method_;
target;
request_version = version;
};
headers;
client_stream = Stream.(stream no_reader no_writer);
server_stream = body;
locals = Scope.empty;
first = request; (* TODO LATER What OCaml version is required for this? *)
last = ref request;
} in

request

let request
?method_
?(target = "/")
Expand Down

0 comments on commit 8652178

Please sign in to comment.