summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/file.c b/file.c
index 4e42c58..e1c209a 100644
--- a/file.c
+++ b/file.c
@@ -126,6 +126,9 @@ static void cgi_setup_env(const char *filepath, const struct http_request *req)
if (req->query_str)
setenv("QUERY_STRING", req->query_str, 1);
+ if (req->cookie)
+ setenv("HTTP_COOKIE", req->cookie, 1);
+
if (req->body) {
static char intbuf[20];
static char *content_type = "application/x-www-form-urlencoded";
@@ -196,6 +199,7 @@ int file_read_cgi(const char *filepath, const char *program, const struct http_r
write(sockfd, buffer, bytes_read);
unsetenv("QUERY_STRING");
+ unsetenv("HTTP_COOKIE");
unsetenv("CONTENT");
unsetenv("CONTENT_LENGTH");