From d7faf7f6d694f67daa0a48381bc821f39186d827 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Fri, 24 Sep 2021 10:00:36 -0400 Subject: Set only HTTP_HOST And only because kcgi expects it. This is what I wrote originally, because every HTTP_ variable should be unset between each request, but this doesn't track them. --- bin/quick.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'bin') diff --git a/bin/quick.c b/bin/quick.c index ae2c99fa..b24aef24 100644 --- a/bin/quick.c +++ b/bin/quick.c @@ -15,7 +15,6 @@ */ #include -#include #include #include #include @@ -70,13 +69,8 @@ static void request(int sock, char *argv[]) { } else if (!strcasecmp(header, "Content-Length")) { bodyLen = strtoull(value, NULL, 10); setenv("CONTENT_LENGTH", value, 1); - } else { - char buf[256]; - for (char *ch = header; *ch; ++ch) { - *ch = (*ch == '-' ? '_' : toupper(*ch)); - } - snprintf(buf, sizeof(buf), "HTTP_%s", header); - setenv(buf, value, 1); + } else if (!strcasecmp(header, "Host")) { + setenv("HTTP_HOST", value, 1); } } -- cgit 1.4.1