diff --git a/tiny_httpd/Tiny_httpd/index.html b/tiny_httpd/Tiny_httpd/index.html index 2e634227..73a277b5 100644 --- a/tiny_httpd/Tiny_httpd/index.html +++ b/tiny_httpd/Tiny_httpd/index.html @@ -105,7 +105,7 @@ echo: ('a, string Tiny_httpd_core.Request.t -> server_sent_generator -> unit) Tiny_httpd_core.Route.t -> 'a -> - unit

Add a handler on an endpoint, that serves server-sent events.

The callback is given a generator that can be used to send events as it pleases. The connection is always closed by the client, and the accepted method is always GET. This will set the header "content-type" to "text/event-stream" automatically and reply with a 200 immediately. See server_sent_generator for more details.

This handler stays on the original thread (it is synchronous).

Upgrade handlers

These handlers upgrade the connection to another protocol.

module type UPGRADE_HANDLER = Server.UPGRADE_HANDLER

Handler that upgrades to another protocol.

type upgrade_handler = (module UPGRADE_HANDLER)
val add_upgrade_handler : + unit

Add a handler on an endpoint, that serves server-sent events.

The callback is given a generator that can be used to send events as it pleases. The connection is always closed by the client, and the accepted method is always GET. This will set the header "content-type" to "text/event-stream" automatically and reply with a 200 immediately. See server_sent_generator for more details.

This handler stays on the original thread (it is synchronous).

Upgrade handlers

These handlers upgrade the connection to another protocol.

module type UPGRADE_HANDLER = Server.UPGRADE_HANDLER

Handler that upgrades to another protocol.

type upgrade_handler = (module UPGRADE_HANDLER)
val add_upgrade_handler : ?accept: (unit Tiny_httpd_core.Request.t -> (unit, Tiny_httpd_core.Response_code.t * string) result) -> diff --git a/tiny_httpd/Tiny_httpd_core/Request/index.html b/tiny_httpd/Tiny_httpd_core/Request/index.html index abe30a86..718f6ce5 100644 --- a/tiny_httpd/Tiny_httpd_core/Request/index.html +++ b/tiny_httpd/Tiny_httpd_core/Request/index.html @@ -1,5 +1,5 @@ -Request (tiny_httpd.Tiny_httpd_core.Request)

Module Tiny_httpd_core.Request

Requests

Requests are sent by a client, e.g. a web browser or cURL. From the point of view of the server, they're inputs.

type 'body t = private {
  1. meth : Meth.t;
    (*

    HTTP method for this request.

    *)
  2. host : string;
    (*

    Host header, mandatory. It can also be found in headers.

    *)
  3. client_addr : Unix.sockaddr;
    (*

    Client address. Available since 0.14.

    *)
  4. headers : Headers.t;
    (*

    List of headers.

    *)
  5. mutable meta : Hmap.t;
    (*

    Metadata.

    • since NEXT_RELEASE
    *)
  6. http_version : int * int;
    (*

    HTTP version. This should be either 1, 0 or 1, 1.

    *)
  7. path : string;
    (*

    Full path of the requested URL.

    *)
  8. path_components : string list;
    (*

    Components of the path of the requested URL.

    *)
  9. query : (string * string) list;
    (*

    Query part of the requested URL.

    *)
  10. body : 'body;
    (*

    Body of the request.

    *)
  11. start_time : float;
    (*

    Obtained via get_time_s in create

    • since 0.11
    *)
}

A request with method, path, host, headers, and a body, sent by a client.

The body is polymorphic because the request goes through several transformations. First it has no body, as only the request and headers are read; then it has a stream body; then the body might be entirely read as a string via read_body_full.

  • since 0.6 The field [query] was added and contains the query parameters in ["?foo=bar,x=y"]
  • since 0.6 The field [path_components] is the part of the path that precedes [query] and is split on ["/"].
  • since 0.11 the type is a private alias
  • since 0.11 the field [start_time] was added
val add_meta : _ t -> 'a Hmap.key -> 'a -> unit

Add metadata

  • since NEXT_RELEASE
val get_meta : _ t -> 'a Hmap.key -> 'a option

Get metadata

  • since NEXT_RELEASE
val get_meta_exn : _ t -> 'a Hmap.key -> 'a

Like get_meta but can fail

  • raises Invalid_argument

    if not present

  • since NEXT_RELEASE
val pp_with : +Request (tiny_httpd.Tiny_httpd_core.Request)

Module Tiny_httpd_core.Request

Requests

Requests are sent by a client, e.g. a web browser or cURL. From the point of view of the server, they're inputs.

type 'body t = private {
  1. meth : Meth.t;
    (*

    HTTP method for this request.

    *)
  2. host : string;
    (*

    Host header, mandatory. It can also be found in headers.

    *)
  3. client_addr : Unix.sockaddr;
    (*

    Client address. Available since 0.14.

    *)
  4. headers : Headers.t;
    (*

    List of headers.

    *)
  5. mutable meta : Hmap.t;
    (*

    Metadata.

    • since 0.17
    *)
  6. http_version : int * int;
    (*

    HTTP version. This should be either 1, 0 or 1, 1.

    *)
  7. path : string;
    (*

    Full path of the requested URL.

    *)
  8. path_components : string list;
    (*

    Components of the path of the requested URL.

    *)
  9. query : (string * string) list;
    (*

    Query part of the requested URL.

    *)
  10. body : 'body;
    (*

    Body of the request.

    *)
  11. start_time : float;
    (*

    Obtained via get_time_s in create

    • since 0.11
    *)
}

A request with method, path, host, headers, and a body, sent by a client.

The body is polymorphic because the request goes through several transformations. First it has no body, as only the request and headers are read; then it has a stream body; then the body might be entirely read as a string via read_body_full.

  • since 0.6 The field [query] was added and contains the query parameters in ["?foo=bar,x=y"]
  • since 0.6 The field [path_components] is the part of the path that precedes [query] and is split on ["/"].
  • since 0.11 the type is a private alias
  • since 0.11 the field [start_time] was added
val add_meta : _ t -> 'a Hmap.key -> 'a -> unit

Add metadata

  • since 0.17
val get_meta : _ t -> 'a Hmap.key -> 'a option

Get metadata

  • since 0.17
val get_meta_exn : _ t -> 'a Hmap.key -> 'a

Like get_meta but can fail

  • raises Invalid_argument

    if not present

  • since 0.17
val pp_with : ?mask_header:(string -> bool) -> ?headers_to_mask:string list -> ?show_query:bool -> @@ -7,7 +7,7 @@ unit -> Stdlib.Format.formatter -> 'body t -> - unit

Pretty print the request. The exact format of this printing is not specified.

  • parameter mask_header

    function which is given each header name. If it returns true, the header's value is masked. The presence of the header is still printed. Default fun _ -> false.

  • parameter headers_to_mask

    a list of headers masked by default. Default is "authorization"; "cookie". @show_query if true (default true), the query part of the request is shown.

  • parameter pp_body

    body printer (default prints "?" instead of the body, which works even for stream bodies)

val pp : Stdlib.Format.formatter -> string t -> unit

Pretty print the request and its body. The exact format of this printing is not specified.

val pp_ : Stdlib.Format.formatter -> _ t -> unit

Pretty print the request without its body. The exact format of this printing is not specified.

val headers : _ t -> Headers.t

List of headers of the request, including "Host".

val get_header : ?f:(string -> string) -> _ t -> string -> string option

get_header req h looks up header h in req. It returns None if the header is not present. This is case insensitive and should be used rather than looking up h verbatim in headers.

val get_header_int : _ t -> string -> int option

Same as get_header but also performs a string to integer conversion.

val set_header : string -> string -> 'a t -> 'a t

set_header k v req sets k: v in the request req's headers.

val remove_header : string -> 'a t -> 'a t

Remove one instance of this header.

  • since NEXT_RELEASE
val update_headers : (Headers.t -> Headers.t) -> 'a t -> 'a t

Modify headers using the given function.

  • since 0.11
val set_body : 'a -> _ t -> 'a t

set_body b req returns a new query whose body is b.

  • since 0.11
val host : _ t -> string

Host field of the request. It also appears in the headers.

val client_addr : _ t -> Unix.sockaddr

Client address of the request.

  • since 0.16
val meth : _ t -> Meth.t

Method for the request.

val path : _ t -> string

Request path.

val query : _ t -> (string * string) list

Decode the query part of the path field.

  • since 0.4
val body : 'b t -> 'b

Request body, possibly empty.

val start_time : _ t -> float

time stamp (from Unix.gettimeofday) after parsing the first line of the request

  • since 0.11
val limit_body_size : + unit

Pretty print the request. The exact format of this printing is not specified.

  • parameter mask_header

    function which is given each header name. If it returns true, the header's value is masked. The presence of the header is still printed. Default fun _ -> false.

  • parameter headers_to_mask

    a list of headers masked by default. Default is "authorization"; "cookie". @show_query if true (default true), the query part of the request is shown.

  • parameter pp_body

    body printer (default prints "?" instead of the body, which works even for stream bodies)

val pp : Stdlib.Format.formatter -> string t -> unit

Pretty print the request and its body. The exact format of this printing is not specified.

val pp_ : Stdlib.Format.formatter -> _ t -> unit

Pretty print the request without its body. The exact format of this printing is not specified.

val headers : _ t -> Headers.t

List of headers of the request, including "Host".

val get_header : ?f:(string -> string) -> _ t -> string -> string option

get_header req h looks up header h in req. It returns None if the header is not present. This is case insensitive and should be used rather than looking up h verbatim in headers.

val get_header_int : _ t -> string -> int option

Same as get_header but also performs a string to integer conversion.

val set_header : string -> string -> 'a t -> 'a t

set_header k v req sets k: v in the request req's headers.

val remove_header : string -> 'a t -> 'a t

Remove one instance of this header.

  • since 0.17
val update_headers : (Headers.t -> Headers.t) -> 'a t -> 'a t

Modify headers using the given function.

  • since 0.11
val set_body : 'a -> _ t -> 'a t

set_body b req returns a new query whose body is b.

  • since 0.11
val host : _ t -> string

Host field of the request. It also appears in the headers.

val client_addr : _ t -> Unix.sockaddr

Client address of the request.

  • since 0.16
val meth : _ t -> Meth.t

Method for the request.

val path : _ t -> string

Request path.

val query : _ t -> (string * string) list

Decode the query part of the path field.

  • since 0.4
val body : 'b t -> 'b

Request body, possibly empty.

val start_time : _ t -> float

time stamp (from Unix.gettimeofday) after parsing the first line of the request

  • since 0.11
val limit_body_size : max_size:int -> bytes:bytes -> IO.Input.t t -> diff --git a/tiny_httpd/Tiny_httpd_core/Response/index.html b/tiny_httpd/Tiny_httpd_core/Response/index.html index b1e40220..03585fd4 100644 --- a/tiny_httpd/Tiny_httpd_core/Response/index.html +++ b/tiny_httpd/Tiny_httpd_core/Response/index.html @@ -1,5 +1,5 @@ -Response (tiny_httpd.Tiny_httpd_core.Response)

Module Tiny_httpd_core.Response

Responses

Responses are what a http server, such as Tiny_httpd, send back to the client to answer a Request.t

type body = [
  1. | `String of string
  2. | `Stream of IO.Input.t
  3. | `Writer of IO.Writer.t
  4. | `Void
]

Body of a response, either as a simple string, or a stream of bytes, or nothing (for server-sent events notably).

  • `String str replies with a body set to this string, and a known content-length.
  • `Stream str replies with a body made from this string, using chunked encoding.
  • `Void replies with no body.
  • `Writer w replies with a body created by the writer w, using a chunked encoding. It is available since 0.14.
type t = private {
  1. code : Response_code.t;
    (*

    HTTP response code. See Response_code.

    *)
  2. headers : Headers.t;
    (*

    Headers of the reply. Some will be set by Tiny_httpd automatically.

    *)
  3. body : body;
    (*

    Body of the response. Can be empty.

    *)
}

A response to send back to a client.

val set_body : body -> t -> t

Set the body of the response.

  • since 0.11
val set_header : string -> string -> t -> t

Set a header.

  • since 0.11
val update_headers : (Headers.t -> Headers.t) -> t -> t

Modify headers.

  • since 0.11
val remove_header : string -> t -> t

Remove one instance of this header.

  • since NEXT_RELEASE
val set_headers : Headers.t -> t -> t

Set all headers.

  • since 0.11
val set_code : Response_code.t -> t -> t

Set the response code.

  • since 0.11
val make_raw : ?headers:Headers.t -> code:Response_code.t -> string -> t

Make a response from its raw components, with a string body. Use "" to not send a body at all.

val make_raw_stream : +Response (tiny_httpd.Tiny_httpd_core.Response)

Module Tiny_httpd_core.Response

Responses

Responses are what a http server, such as Tiny_httpd, send back to the client to answer a Request.t

type body = [
  1. | `String of string
  2. | `Stream of IO.Input.t
  3. | `Writer of IO.Writer.t
  4. | `Void
]

Body of a response, either as a simple string, or a stream of bytes, or nothing (for server-sent events notably).

  • `String str replies with a body set to this string, and a known content-length.
  • `Stream str replies with a body made from this string, using chunked encoding.
  • `Void replies with no body.
  • `Writer w replies with a body created by the writer w, using a chunked encoding. It is available since 0.14.
type t = private {
  1. code : Response_code.t;
    (*

    HTTP response code. See Response_code.

    *)
  2. headers : Headers.t;
    (*

    Headers of the reply. Some will be set by Tiny_httpd automatically.

    *)
  3. body : body;
    (*

    Body of the response. Can be empty.

    *)
}

A response to send back to a client.

val set_body : body -> t -> t

Set the body of the response.

  • since 0.11
val set_header : string -> string -> t -> t

Set a header.

  • since 0.11
val update_headers : (Headers.t -> Headers.t) -> t -> t

Modify headers.

  • since 0.11
val remove_header : string -> t -> t

Remove one instance of this header.

  • since 0.17
val set_headers : Headers.t -> t -> t

Set all headers.

  • since 0.11
val set_code : Response_code.t -> t -> t

Set the response code.

  • since 0.11
val make_raw : ?headers:Headers.t -> code:Response_code.t -> string -> t

Make a response from its raw components, with a string body. Use "" to not send a body at all.

val make_raw_stream : ?headers:Headers.t -> code:Response_code.t -> IO.Input.t -> diff --git a/tiny_httpd/Tiny_httpd_core/Response_code/index.html b/tiny_httpd/Tiny_httpd_core/Response_code/index.html index f59dc6e3..c031eb82 100644 --- a/tiny_httpd/Tiny_httpd_core/Response_code/index.html +++ b/tiny_httpd/Tiny_httpd_core/Response_code/index.html @@ -1,2 +1,2 @@ -Response_code (tiny_httpd.Tiny_httpd_core.Response_code)

Module Tiny_httpd_core.Response_code

Response Codes

type t = int

A standard HTTP code.

https://tools.ietf.org/html/rfc7231#section-6

val ok : t

The code 200

val not_found : t

The code 404

val descr : t -> string

A description of some of the error codes. NOTE: this is not complete (yet).

val is_success : t -> bool

is_success code is true iff code is in the 2xx or 3xx range.

  • since NEXT_RELEASE
+Response_code (tiny_httpd.Tiny_httpd_core.Response_code)

Module Tiny_httpd_core.Response_code

Response Codes

type t = int

A standard HTTP code.

https://tools.ietf.org/html/rfc7231#section-6

val ok : t

The code 200

val not_found : t

The code 404

val descr : t -> string

A description of some of the error codes. NOTE: this is not complete (yet).

val is_success : t -> bool

is_success code is true iff code is in the 2xx or 3xx range.

  • since 0.17
diff --git a/tiny_httpd/Tiny_httpd_core/Server/Head_middleware/index.html b/tiny_httpd/Tiny_httpd_core/Server/Head_middleware/index.html index fa947a25..a8a8e486 100644 --- a/tiny_httpd/Tiny_httpd_core/Server/Head_middleware/index.html +++ b/tiny_httpd/Tiny_httpd_core/Server/Head_middleware/index.html @@ -1,2 +1,2 @@ -Head_middleware (tiny_httpd.Tiny_httpd_core.Server.Head_middleware)

Module Server.Head_middleware

A middleware that only considers the request's head+headers.

These middlewares are simpler than full Middleware.t and work in more contexts.

  • since NEXT_RELEASE
type t = {
  1. handle : 'a. 'a Request.t -> 'a Request.t;
}

A handler that takes the request, without its body, and possibly modifies it.

  • since NEXT_RELEASE
val trivial : t

Pass through

val to_middleware : t -> Middleware.t
+Head_middleware (tiny_httpd.Tiny_httpd_core.Server.Head_middleware)

Module Server.Head_middleware

A middleware that only considers the request's head+headers.

These middlewares are simpler than full Middleware.t and work in more contexts.

  • since 0.17
type t = {
  1. handle : 'a. 'a Request.t -> 'a Request.t;
}

A handler that takes the request, without its body, and possibly modifies it.

  • since 0.17
val trivial : t

Pass through

val to_middleware : t -> Middleware.t
diff --git a/tiny_httpd/Tiny_httpd_core/Server/index.html b/tiny_httpd/Tiny_httpd_core/Server/index.html index 3e549ede..3a5da2d2 100644 --- a/tiny_httpd/Tiny_httpd_core/Server/index.html +++ b/tiny_httpd/Tiny_httpd_core/Server/index.html @@ -34,7 +34,7 @@ t -> ('a, string Request.t -> server_sent_generator -> unit) Route.t -> 'a -> - unit

Add a handler on an endpoint, that serves server-sent events.

The callback is given a generator that can be used to send events as it pleases. The connection is always closed by the client, and the accepted method is always GET. This will set the header "content-type" to "text/event-stream" automatically and reply with a 200 immediately. See server_sent_generator for more details.

This handler stays on the original thread (it is synchronous).

  • since 0.9

Upgrade handlers

These handlers upgrade the connection to another protocol.

  • since NEXT_RELEASE
module type UPGRADE_HANDLER = sig ... end

Handler that upgrades to another protocol.

type upgrade_handler = (module UPGRADE_HANDLER)
  • since NEXT_RELEASE
val add_upgrade_handler : + unit

Add a handler on an endpoint, that serves server-sent events.

The callback is given a generator that can be used to send events as it pleases. The connection is always closed by the client, and the accepted method is always GET. This will set the header "content-type" to "text/event-stream" automatically and reply with a 200 immediately. See server_sent_generator for more details.

This handler stays on the original thread (it is synchronous).

  • since 0.9

Upgrade handlers

These handlers upgrade the connection to another protocol.

  • since 0.17
module type UPGRADE_HANDLER = sig ... end

Handler that upgrades to another protocol.

type upgrade_handler = (module UPGRADE_HANDLER)
  • since 0.17
val add_upgrade_handler : ?accept:(unit Request.t -> (unit, Response_code.t * string) result) -> ?middlewares:Head_middleware.t list -> t -> diff --git a/tiny_httpd/Tiny_httpd_core/Server/module-type-UPGRADE_HANDLER/index.html b/tiny_httpd/Tiny_httpd_core/Server/module-type-UPGRADE_HANDLER/index.html index 73171390..061bfa6c 100644 --- a/tiny_httpd/Tiny_httpd_core/Server/module-type-UPGRADE_HANDLER/index.html +++ b/tiny_httpd/Tiny_httpd_core/Server/module-type-UPGRADE_HANDLER/index.html @@ -1,5 +1,5 @@ -UPGRADE_HANDLER (tiny_httpd.Tiny_httpd_core.Server.UPGRADE_HANDLER)

Module type Server.UPGRADE_HANDLER

Handler that upgrades to another protocol.

  • since NEXT_RELEASE
type handshake_state

Some specific state returned after handshake

val name : string

Name in the "upgrade" header

val handshake : +UPGRADE_HANDLER (tiny_httpd.Tiny_httpd_core.Server.UPGRADE_HANDLER)

Module type Server.UPGRADE_HANDLER

Handler that upgrades to another protocol.

  • since 0.17
type handshake_state

Some specific state returned after handshake

val name : string

Name in the "upgrade" header

val handshake : Unix.sockaddr -> unit Request.t -> (Headers.t * handshake_state, string) result

Perform the handshake and upgrade the connection. This returns either Ok (resp_headers, state) in case of success, in which case the server sends a 101 response with resp_headers; or it returns Error log_msg if the the handshake fails, in which case the connection is closed without further ado and log_msg is logged locally (but not returned to the client).

val handle_connection : handshake_state -> IO.Input.t -> IO.Output.t -> unit

Take control of the connection and take it from ther.e

diff --git a/tiny_httpd/Tiny_httpd_core/Util/index.html b/tiny_httpd/Tiny_httpd_core/Util/index.html index 9d1f0bc3..9b97e601 100644 --- a/tiny_httpd/Tiny_httpd_core/Util/index.html +++ b/tiny_httpd/Tiny_httpd_core/Util/index.html @@ -1,2 +1,2 @@ -Util (tiny_httpd.Tiny_httpd_core.Util)

Module Tiny_httpd_core.Util

Some utils for writing web servers

  • since 0.2
val percent_encode : ?skip:(char -> bool) -> string -> string

Encode the string into a valid path following https://tools.ietf.org/html/rfc3986#section-2.1

  • parameter skip

    if provided, allows to preserve some characters, e.g. '/' in a path.

val percent_decode : string -> string option

Inverse operation of percent_encode. Can fail since some strings are not valid percent encodings.

val split_query : string -> string * string

Split a path between the path and the query

  • since 0.5
val split_on_slash : string -> string list

Split a string on '/', remove the trailing '/' if any.

  • since 0.6
val get_non_query_path : string -> string

get the part of the path that is not the query parameters.

  • since 0.5
val get_query : string -> string

Obtain the query part of a path.

  • since 0.4
val parse_query : string -> ((string * string) list, string) result

Parse a query as a list of '&' or ';' separated key=value pairs. The order might not be preserved.

  • since 0.3
val show_sockaddr : Unix.sockaddr -> string

Simple printer for socket addresses.

  • since NEXT_RELEASE
val is_ipv6_str : string -> bool

Is this string potentially an IPV6 address?

  • since NEXT_RELEASE
+Util (tiny_httpd.Tiny_httpd_core.Util)

Module Tiny_httpd_core.Util

Some utils for writing web servers

  • since 0.2
val percent_encode : ?skip:(char -> bool) -> string -> string

Encode the string into a valid path following https://tools.ietf.org/html/rfc3986#section-2.1

  • parameter skip

    if provided, allows to preserve some characters, e.g. '/' in a path.

val percent_decode : string -> string option

Inverse operation of percent_encode. Can fail since some strings are not valid percent encodings.

val split_query : string -> string * string

Split a path between the path and the query

  • since 0.5
val split_on_slash : string -> string list

Split a string on '/', remove the trailing '/' if any.

  • since 0.6
val get_non_query_path : string -> string

get the part of the path that is not the query parameters.

  • since 0.5
val get_query : string -> string

Obtain the query part of a path.

  • since 0.4
val parse_query : string -> ((string * string) list, string) result

Parse a query as a list of '&' or ';' separated key=value pairs. The order might not be preserved.

  • since 0.3
val show_sockaddr : Unix.sockaddr -> string

Simple printer for socket addresses.

  • since 0.17
val is_ipv6_str : string -> bool

Is this string potentially an IPV6 address?

  • since 0.17
diff --git a/tiny_httpd/_doc-dir/CHANGES.md b/tiny_httpd/_doc-dir/CHANGES.md index 2f670075..fd440d18 100644 --- a/tiny_httpd/_doc-dir/CHANGES.md +++ b/tiny_httpd/_doc-dir/CHANGES.md @@ -1,6 +1,32 @@ ## Pending +## 0.17 + +- add optional middlewares to tiny_httpd_ws +- add `Head_middleware.trivial` +- add `Head_middleware.t`; accept it for SSE/websocket +- add `Request.pp_with` which is a customizable printer +- expose `Response.Bad_req` +- use `iostream` for IOs +- add a `hmap`-typed field to requests, to carry request specific data + across middlewares +- http_of_dir: ability to setup socket timeout +- add `tiny_httpd.ws`, a websocket library +- add `Response_code.is_success` + - fix: No setting of sigprocmask on Windows +- fix: give the correct code+error if protocol upgrade fails +- remove potentially security-leaking debug line +- fix: avoid collisions in `Mime_` private module +- fix middlewares: merge-sort per-request middleares and global ones +- fix tiny_httpd dir: handle html files + +- perf: optim in read_line +- perf: remove some uses of scanf in parsing + +- require iostream-camlzip >= 0.2.1 +- add optional dependency on `logs` +- logs is a testdep for tiny_httpd_camlzip ## 0.16 diff --git a/tiny_httpd_camlzip/_doc-dir/CHANGES.md b/tiny_httpd_camlzip/_doc-dir/CHANGES.md index 2f670075..fd440d18 100644 --- a/tiny_httpd_camlzip/_doc-dir/CHANGES.md +++ b/tiny_httpd_camlzip/_doc-dir/CHANGES.md @@ -1,6 +1,32 @@ ## Pending +## 0.17 + +- add optional middlewares to tiny_httpd_ws +- add `Head_middleware.trivial` +- add `Head_middleware.t`; accept it for SSE/websocket +- add `Request.pp_with` which is a customizable printer +- expose `Response.Bad_req` +- use `iostream` for IOs +- add a `hmap`-typed field to requests, to carry request specific data + across middlewares +- http_of_dir: ability to setup socket timeout +- add `tiny_httpd.ws`, a websocket library +- add `Response_code.is_success` + - fix: No setting of sigprocmask on Windows +- fix: give the correct code+error if protocol upgrade fails +- remove potentially security-leaking debug line +- fix: avoid collisions in `Mime_` private module +- fix middlewares: merge-sort per-request middleares and global ones +- fix tiny_httpd dir: handle html files + +- perf: optim in read_line +- perf: remove some uses of scanf in parsing + +- require iostream-camlzip >= 0.2.1 +- add optional dependency on `logs` +- logs is a testdep for tiny_httpd_camlzip ## 0.16