$Log$
+Revision 323.56 2002/08/13 19:55:12 ajc
+* Keep track of the HTTP "Host:" header being sent by the browser.
+ (We're going to need this in the near future)
+
Revision 323.55 2002/08/05 16:07:30 ajc
* Moved "edit floor label pic" to the floor editing screen
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
-
wprintf("<INPUT TYPE=\"text\" NAME=\"g_cmd\" SIZE=80 MAXLENGTH=\"250\"><BR>\n");
wprintf("Command input (if requesting SEND_LISTING transfer mode):<BR>\n");
- wprintf("<TEXTAREA NAME=\"g_input\" ROWS=10 COLS=80 WIDTH=80></TEXTAREA>\n");
+ wprintf("<TEXTAREA NAME=\"g_input\" ROWS=10 COLS=80 WIDTH=80></TEXTAREA><BR>\n");
+ wprintf("<FONT SIZE=-2>Detected host header is http://%s</FONT>\n",
+ WC->http_host);
wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Send command\">");
wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><BR>\n");
ContentLength = atoi(&buf[16]);
}
else if (!strncasecmp(buf, "Content-type: ", 14)) {
- strcpy(ContentType, &buf[14]);
+ safestrncpy(ContentType, &buf[14], sizeof ContentType);
}
else if (!strncasecmp(buf, "User-agent: ", 12)) {
- strcpy(user_agent, &buf[12]);
+ safestrncpy(user_agent, &buf[12], sizeof user_agent);
+ }
+ else if (!strncasecmp(buf, "Host: ", 6)) {
+ safestrncpy(WC->http_host, &buf[6], sizeof WC->http_host);
}
/* Only WAP gateways explicitly name this content-type */
else if (strstr(buf, "text/vnd.wap.wml")) {
struct urlcontent *urlstrings;
int HaveExpressMessages; /* Nonzero if incoming msgs exist */
struct wcsubst *vars;
- char *preferences;
char this_page[SIZ]; /* address of current page */
+ char http_host[SIZ]; /* HTTP Host: header */
+ char *preferences;
};
#define extract(dest,source,parmnum) extract_token(dest,source,parmnum,'|')