From d56d5882e6b5b8205cdeec7d547c78ce7125d5ff Mon Sep 17 00:00:00 2001 From: "L. Pereira" Date: Sun, 28 Apr 2024 20:04:49 -0700 Subject: [PATCH] FastCGI module requires chunked encoding So error out if the request is HTTP/1.0. --- src/lib/lwan-mod-fastcgi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/lwan-mod-fastcgi.c b/src/lib/lwan-mod-fastcgi.c index 13339f284..7fa351edc 100644 --- a/src/lib/lwan-mod-fastcgi.c +++ b/src/lib/lwan-mod-fastcgi.c @@ -423,6 +423,13 @@ static void reset_additional_header(void *data) static enum lwan_http_status try_initiating_chunked_response(struct lwan_request *request) { + if (request->flags & REQUEST_IS_HTTP_1_0) { + /* Chunked encoding is not supported in HTTP/1.0. We don't have a + * way to buffer the responses in this module yet, so return an + * error here. */ + return HTTP_NOT_IMPLEMENTED; + } + struct lwan_response *response = &request->response; char *header_start[N_HEADER_START]; char *next_request;