httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sterling <sterl...@covalent.net>
Subject [PATCH] When apache generates html it should probably set the content type
Date Tue, 20 Nov 2001 20:55:55 GMT
Hi -

If you're default content type is something other than text/html and you
hit ap_send_error_response - apache sends html, but the content-type may
be something else.

this patch ensures that the content type is properly set if we return
html.  Anyone see any better way to handle this?

This can be reproduced by setting ErrorDocument 401, setting your default
content type to text/plain, and turning on auth in <Location />.  Simply
log in with an improper username and html will be rendered as plain text.

 sterling


Index: http_protocol.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/http/http_protocol.c,v
retrieving revision 1.379
diff -u -r1.379 http_protocol.c
--- http_protocol.c	2001/11/08 19:35:32	1.379
+++ http_protocol.c	2001/11/20 19:36:18
@@ -1914,7 +1914,7 @@
         /* can't count on a charset filter being in place here,
          * so do ebcdic->ascii translation explicitly (if needed)
          */
-
+        rlast->content_type = "text/html";
         ap_rvputs_proto_in_ascii(rlast,
                   DOCTYPE_HTML_2_0
                   "<html><head>\n<title>", title,


Mime
View raw message