httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <r...@imdb.com>
Subject internal redirects after HEAD
Date Sat, 30 Nov 1996 23:38:26 GMT


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

Mime
View raw message