1.3.26 and missing Content-Type
am 30.06.2002 12:21:41 von Matthias KurzHi.
Users reported a problem with pages like
http://cgi3.ebay.de/aw-cgi/eBayISAPI.dll?SignIn
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", r->content_type);
/* finally output the headers to the client */
Questions:
----------
- 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
^^^ =
- 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 ?
Thanks
(mk)
--
Matthias Kurz; Fuldastr. 3; D-28199 Bremen; VOICE +49 421 53 600 47
>> Im prämotorischen Cortex kann jeder ein Held sein. (bdw) <<