ocaml-cohttp icon indicating copy to clipboard operation
ocaml-cohttp copied to clipboard

cohttp-eio(server): reject request with 411 if Content-Length is not provided.

Open bikallem opened this issue 3 years ago • 2 comments

According to RFC 7230

A server MAY reject a request that contains a message body but not a Content-Length by responding with 411 > (Length Required).

Therefore reject requests if Content-Length is not provided but is required.

bikallem avatar Sep 06 '22 13:09 bikallem

It says may. Should we leave it as an implementation detail for the library users to implement?

mseri avatar Sep 06 '22 17:09 mseri

It says may. Should we leave it as an implementation detail for the library users to implement?

Yes, it will be opt in - implemented via middleware - but the functionality will be available from cohttp-eio package.

bikallem avatar Sep 07 '22 08:09 bikallem