[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
LYNX-DEV lynxcgi: CONTENT_TYPE fix
From: |
Ty Sarna |
Subject: |
LYNX-DEV lynxcgi: CONTENT_TYPE fix |
Date: |
Sun, 21 Dec 1997 20:47:43 -0600 (CST) |
I didn't recieve any feedback about the lynxcgi: missing CONTENT_TYPE
environment variable, so I patched it myself. Reading the CGI spec, it
seems to be required on PUT and POST at a minimum. I set it always, if
it's availible (otherwise it's set but empty).
--- src/LYCgi.c.orig Tue Nov 4 16:55:08 1997
+++ src/LYCgi.c Sun Dec 21 20:39:08 1997
@@ -300,6 +300,7 @@
HTStream *target = NULL; /* Unconverted data */
int fd1[2], fd2[2];
char buf[1024];
+ char content_type[128];
pid_t pid;
#if HAVE_TYPE_UNIONWAIT
union wait wstatus;
@@ -472,6 +473,13 @@
StrAllocCat(cp, pref_charset);
add_environment_value(cp);
}
+
+ strcpy(content_type, "CONTENT_TYPE=");
+ if (anAnchor->post_content_type) {
+ strncat(content_type, anAnchor->post_content_type,
+ sizeof(content_type) - sizeof("CONTENT_TYPE="));
+ }
+ add_environment_value(content_type);
if (anAnchor->post_data) { /* post script, read stdin */
close(fd1[1]);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- LYNX-DEV lynxcgi: CONTENT_TYPE fix,
Ty Sarna <=