You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by ra...@bellglobal.com on 1996/08/23 15:31:11 UTC
Double content-type bug - false alarm
I had a closer look at this. It was my own bug. Didn't realize it was
a bad thing to table_set() the content-type string in a module. When
Apache sends the header, it isn't smart enough to notice that the
content-type is defined in the header table and goes ahead and sends it
even though it already sent the content-type string from r->content_type.
Not really a bug, but it might be nice if there was a little check to
precent this. Something like:
*** http_protocol.c Sun Jun 23 14:05:16 1996
--- http_protocol.c.new Fri Aug 23 09:25:25 1996
***************
*** 730,733 ****
--- 730,734 ----
for (i = 0; i < hdrs_arr->nelts; ++i) {
if (!hdrs[i].key) continue;
+ if(!strcasecmp(hdrs[i].key,"content-type") && r->content_type)
continue;
bvputs(fd, hdrs[i].key, ": ", hdrs[i].val, "\015\012", NULL);
}
This assumes the r->content_type is the appropriate content type to send.
The check could be earlier on and made to skip sending r->content_type
if a content_type header table element exists. Not sure which is
preferred. But it is certainly appropriate to only send one.
-Rasmus