From 563cb35bc0997f57de85d3388c9b1ddba2ed42a6 Mon Sep 17 00:00:00 2001 From: Drew Crampsie Date: Wed, 15 Jan 2025 00:33:19 +0000 Subject: [PATCH] Fix gxhttpd bug: No content length when chunking --- src/tools/gxhttpd.ss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tools/gxhttpd.ss b/src/tools/gxhttpd.ss index 7f2e02b40..8d30104a3 100644 --- a/src/tools/gxhttpd.ss +++ b/src/tools/gxhttpd.ss @@ -283,7 +283,7 @@ (mux (make-mux cfg)) (request-logger (get-request-logger cfg)) (addresses (config-get! cfg listen:)) - (max-token-length (: (config-get cfg max-token-length: 1024) :fixnum)) + (max-token-length (: (config-get cfg max-token-length: 1024) :fixnum)) (run-httpd (lambda () (set-httpd-max-token-length! max-token-length) @@ -501,6 +501,9 @@ (using (req :- http-request) (case req.method ((GET) + ;; RFC 9112 states that "a sender (server) MUST NOT send + ;; a Content-Length header field in any message that + ;; contains a Transfer-Encoding header field.". (http-response-file res (cdr headers) path)) ((HEAD) (http-response-write res 200 headers #f))