httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@gonzo.ben.algroup.co.uk>
Subject Re: internal redirects after HEAD
Date Sun, 01 Dec 1996 13:07:52 GMT
+1

Rob Hartill wrote:
> 
> 
> 
> http_request.c
> 
> 
>         } else if ( custom_response[0] == '/') {
> 	    r->no_local_copy = 1; /* Do NOT send USE_LOCAL_COPY for  
> 			          * error documents!
> 				  */
>   	    /* This redirect needs to be a GET no matter what the original
>   	     * method was.
>   	     */
>   	    r->method = pstrdup(r->pool, "GET");
>   	    r->method_number = M_GET;
>   	    internal_redirect (custom_response, r);
> 
> -=-=-=--=-
> 
> "This redirect needs to be a GET no matter what the original method was".
> 
> I've got a 404 ErrorDocument handler that generates missing documents
> on the fly, and when someone does a "HEAD" I loose track of this fact
> and serve a 200 response of the entire document (makes Apache look broken).
> 
> I've looked but there's no mention of the earlier HEAD (there should be
> a REDIRECT_REQUEST_METHOD env var), so I can't do any detective work
> either to catch this.
> 
> 
> *** http_request.c.orig	Fri Nov 29 00:32:55 1996
> --- http_request.c	Sat Nov 30 23:27:08 1996
> ***************
> *** 738,743 ****
> --- 738,744 ----
>   	    /* This redirect needs to be a GET no matter what the original
>   	     * method was.
>   	     */
> +             table_set(r->subprocess_env, "REQUEST_METHOD", r->method);
>   	    r->method = pstrdup(r->pool, "GET");
>   	    r->method_number = M_GET;
>   	    internal_redirect (custom_response, r);
> 
> 
> ...seems to do the trick - the internal redirect code then creates
> a REDIRECT_REQUEST_METHOD to hold the original (or earlier) method.
> 
> I won't call it a showstopper but I do think it's a bug (since it leaves no
> way to detect the earlier METHOD and recover gracefully).
> 
> rob

-- 
Ben Laurie                Phone: +44 (181) 994 6435  Email: ben@algroup.co.uk
Freelance Consultant and  Fax:   +44 (181) 994 6472
Technical Director        URL: http://www.algroup.co.uk/Apache-SSL
A.L. Digital Ltd,         Apache Group member (http://www.apache.org)
London, England.          Apache-SSL author

Mime
View raw message