[PATCH 1/2] web: Handle ending CRLF (\r\n) for chunked input and output ports.

2022-06-30 Thread Christopher Baines
The chunked transfer encoding specifies the chunked body ends with CRLF. This is in addition to the CRLF at the end of the last chunk, so there should be CRLF twice at the end of the chunked body: https://datatracker.ietf.org/doc/html/rfc2616#section-3.6.1 * module/web/http.scm (make-chunked-in

[PATCH 2/2] web: Don't hide missing data in the chunked input port.

2022-06-30 Thread Christopher Baines
This port is of limited use if it cannot be used reliably. Rather than behaving as if the input has finished when it ends unexpectedly, instead raise an exception. * module/web/http.scm (make-chunked-input-port): Raise an exception on premature termination. (&chunked-input-ended-prematurely): New