Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 32200 invoked by uid 500); 26 Mar 2002 20:55:47 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 32187 invoked from network); 26 Mar 2002 20:55:47 -0000 X-Authentication-Warning: dyn-186.sfo.covalent.net: sterling owned process doing -bs Date: Tue, 26 Mar 2002 12:55:27 -0800 (PST) From: X-X-Sender: To: Subject: Re: HTTP 404 Served As text/plain UPDATE In-Reply-To: <3CA0C550.5FE026C9@weirdness.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Tue, 26 Mar 2002, Jerry Baker wrote: > Jerry Baker wrote: > > > > I just noticed something about this problem. If you request > > /nonexistentfile.html then the error response is sent back with > > text/html, but if you request /nonexistentfile then it still comes back > > as text/plain. > > > > -- > > Jerry Baker > > Not only that. If you request /nonexistentfile.exe, it gets sent back as > application/octet-stream. The ErrorDocument is being returned with > whatever content-type matches the file extension of the requested > document. I doubt many people want to download the ErrorDocument in the > case that they request a non-existent application/octet-stream URI. yeah - the sub request content type is getting set by negotiation, but it is not being propagated up. i am not sure how this is supposed to take place, but the following patch actually makes the content type set properly in my test cases..... although i don't think its the right fix - isn't that content type supposed to be propagated? i know this stuff is kinda whacky - maybe this sheds some light on the situation. anyways here's the patch Index: modules/mappers/mod_negotiation.c =================================================================== RCS file: /home/cvspublic/httpd-2.0/modules/mappers/mod_negotiation.c,v retrieving revision 1.100 diff -u -r1.100 mod_negotiation.c --- modules/mappers/mod_negotiation.c 20 Mar 2002 17:41:55 -0000 1.100 +++ modules/mappers/mod_negotiation.c 26 Mar 2002 20:54:33 -0000 @@ -942,10 +942,13 @@ } else if (!strncmp(buffer, "content-type:", 13)) { struct accept_rec accept_info; + request_rec *tmp_req; get_entry(neg->pool, &accept_info, body); set_mime_fields(&mime_info, &accept_info); has_content = 1; + for( tmp_req = r; tmp_req != NULL; tmp_req = tmp_req->prev ) + tmp_req->content_type = mime_info.mime_type; } else if (!strncmp(buffer, "content-length:", 15)) { mime_info.bytes = atol(body);