--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: libapache-mod-lisp: does case-sensitive compare of response headers
- From: Chris Hanson <cph@debian.org>
- Date: Mon, 14 Jul 2003 23:46:32 -0400
- Message-id: <E19cGls-0001po-00@nuwen.ai.mit.edu>
Package: libapache-mod-lisp
Version: 2.32-1
Severity: normal
Tags: upstream, patch
When reading response headers sent by the lisp process, mod_lisp.c
compares these headers to several known strings, but it uses a
case-sensitive comparison. HTTP headers are case-insensitive, so a
case-sensitive comparison is inappropriate.
Furthermore, this makes it more difficult to use symbols as header
names in the lisp process, since symbols typically print in a
canonical case.
I've attached an untested patch that should fix the problem.
-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux nuwen 2.4.21 #1 Sat Jun 14 00:03:54 EDT 2003 i686
Locale: LANG=C, LC_CTYPE=C
Versions of packages libapache-mod-lisp depends on:
ii libc6 2.3.1-17 GNU C Library: Shared libraries an
ii libdb4.1 4.1.25-4 Berkeley v4.1 Database Libraries [
ii libexpat1 1.95.6-4 XML parsing C library - runtime li
-- no debconf information
--- mod_lisp.c.~1~ 2003-07-11 13:58:11.000000000 -0400
+++ mod_lisp.c 2003-07-14 23:39:14.000000000 -0400
@@ -664,7 +664,7 @@
{
if (!elts[i].key) continue;
ret = SendLispHeaderLine(BuffSocket,
- !strcmp(elts[i].key, "end")?"end-header":elts[i].key,
+ !strcasecmp(elts[i].key, "end")?"end-header":elts[i].key,
elts[i].val);
if (ret!=0)
{
@@ -726,7 +726,7 @@
Header[l-1] = 0;
ap_kill_timeout(r);
- if (!strcmp(Header, "end"))
+ if (!strcasecmp(Header, "end"))
break;
if (ap_bgets(Value, MAX_STRING_LEN, (BUFF *) BuffSocket) <= 0)
@@ -736,45 +736,45 @@
if (l > 0)
Value[l-1] = 0;
- if (!strcmp(Header, "Content-Type"))
+ if (!strcasecmp(Header, "Content-Type"))
{
char *tmp = ap_pstrdup(r->pool, Value);
ap_content_type_tolower(tmp);
r->content_type = tmp;
}
- else if (!strcmp(Header, "Status"))
+ else if (!strcasecmp(Header, "Status"))
{
r->status = atoi(Value);
r->status_line = ap_pstrdup(r->pool, Value);
}
- else if (!strcmp(Header, "Location"))
+ else if (!strcasecmp(Header, "Location"))
{
ap_table_set(r->headers_out, Header, Value);
}
- else if (!strcmp(Header, "Content-Length"))
+ else if (!strcasecmp(Header, "Content-Length"))
{
ap_table_set(r->headers_out, Header, Value);
ContentLength = atoi(Value);
}
- else if (!strcmp(Header, "Last-Modified"))
+ else if (!strcasecmp(Header, "Last-Modified"))
{
time_t mtime = ap_parseHTTPdate(Value);
ap_update_mtime(r, mtime);
ap_set_last_modified(r);
}
- else if (!strcmp(Header, "Keep-Socket"))
+ else if (!strcasecmp(Header, "Keep-Socket"))
{
KeepSocket = atoi(Value);
}
- else if (!strcmp(Header, "Log-Error"))
+ else if (!strcasecmp(Header, "Log-Error"))
{
ap_log_error("mod_lisp", 0, APLOG_ERR, r->server, Value);
}
- else if (!strcmp(Header, "Log"))
+ else if (!strcasecmp(Header, "Log"))
{
ap_log_error("mod_lisp", 0, APLOG_ERR, r->server, Value);
}
- else if (!strcmp(Header, "Note"))
+ else if (!strcasecmp(Header, "Note"))
{
char *pv = strchr(Value, ' ');
if (pv != NULL)
@@ -783,7 +783,7 @@
ap_table_setn(r->notes, ap_pstrdup(r->pool, Value), ap_pstrdup(r->pool, pv));
}
}
- else if (!strcmp(Header, "Set-Cookie"))
+ else if (!strcasecmp(Header, "Set-Cookie"))
{
ap_table_add(r->headers_out, Header, Value);
}
--- End Message ---