www-modproxy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthias Kurz ...@baerlap.north.de>
Subject 1.3.26 and missing Content-Type
Date Sun, 30 Jun 2002 10:21:41 GMT


Users reported a problem with pages like

Problems: Crippled header and missing Content-Type.
As far as i can see, the missing Content-Type leads to the usage of
the DefaultType from httpd.conf. This is usually "text/plain" and leads
to the effect that the HTML code is not interpreted but displayed as
plain text.
Changing the DefaultType in httpd.conf to "text/html" leads to the problem,
that some plain text documents (e.g. README on ftp sites) are displayed as
"HTML" which looks rather ugly.

After i unsuccessfully tried to fiddle with "mime.types" and "magic", i 
applied the following hack:

--- tmp/apache_1.3.26/src/modules/proxy/proxy_http.c    Tue Jun 18 02:59:59 2002
+++ proxy_http.c        Sun Jun 30 11:41:17 2002
@@ -590,6 +590,9 @@
                                ap_get_server_name(r), NULL));
     /* The Content-Type of this response is the upstream one. */
     r->content_type = ap_table_get(r->headers_out, "Content-Type");
+    if (r->content_type == NULL) {
+        r->content_type = "text/html";
+    }
     ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, r->server, "Content-Type: %s",
     /* finally output the headers to the client */

- Will this work (it would make some sense for a http proxy, wouldn't it) ?
  Well, it looks like it fixes the main problem, but are there side effects ?
- Does the proxy really not care about "mime.types" and "magic" in case
  of a missing Content-Type ?
  I tried in "mime.types":
     text/html .dll .dll?SighIn
  and in "magic" (mod_mime_magic is compiled in):
     0       string          \074\150\164\155\154\076        text/html
                             ^^^ = <html>
- Is there another/better way to fix the problem (except asking eBay to
  fix their headers - nobody is availlable)
- Who else is responsible to "guess" a Content-Type ? Need it to be fixed
  there ?



Matthias Kurz; Fuldastr. 3; D-28199 Bremen; VOICE +49 421 53 600 47
   >> Im prämotorischen Cortex kann jeder ein Held sein. (bdw) <<

View raw message