httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Double content-type bug - false alarm
Date Fri, 23 Aug 1996 13:31:11 GMT
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
--- 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)
        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.


View raw message