-/* $OpenBSD: server_fcgi.c,v 1.86 2021/05/17 09:26:52 florian Exp $ */
+/* $OpenBSD: server_fcgi.c,v 1.87 2021/05/19 19:42:53 florian Exp $ */
/*
* Copyright (c) 2014 Florian Obser <florian@openbsd.org>
if (kv_add(&resp->http_headers,
"Transfer-Encoding", "chunked") == NULL)
return (-1);
+ } else {
+ key.kv_key = "Content-Length";
+ if ((kv = kv_find(&resp->http_headers, &key)) == NULL) {
+ if (kv_add(&resp->http_headers,
+ "Content-Length", "0") == NULL)
+ return (-1);
+ }
}
/* Is it a persistent connection? */