Hi Chris, Christopher Baines <m...@cbaines.net> skribis:
> 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-input-port): Read two extra bytes at > the end of the chunked input. > (make-chunked-output-port): Write the missing \r\n when closing the > port. > * test-suite/tests/web-http.test (chunked encoding): Add missing \r\n to > test data. [...] > 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 exception type. > (chunked-input-ended-prematurely-error?): New procedure. > * test-suite/tests/web-http.test (pass-if-named-exception): Rename to > pass-if-named-exception. > (pass-if-named-exception): New syntax. > ("Exception on premature chunk end"): New test for this behaviour. Applied, thanks! Are there servers out there where you would hit this bug? We were “lucky” not to notice before I guess. Ludo’.