You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Dirk-Willem van Gulik (kim)" <di...@webweaving.org> on 1999/04/08 22:45:47 UTC
Why force change to a GET in ErrorDocument on CGI
In ap_die() we check if there is an ErrorDocument
defined; and if so do an internal redirect;
Two issues;
}
else if (custom_response[0] == '/') {
const char *error_notes;
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.
*/
Why ? what is against a HEAD or POST for example ? Even a PUT for that
matter.
ap_table_setn(r->subprocess_env, "REQUEST_METHOD",
r->method);
And this is bogus, as we will 'zap' it in util_script later.
But that is easy to fix in there with a test for error condition change.
/*
* Provide a special method for modules to communicate
* more informative (than the plain canned) messages to us.
* Propagate them to ErrorDocuments via the ERROR_NOTES
variable:
*/
if ((error_notes = ap_table_get(r->notes, "error-notes")) !=
NULL) {
ap_table_setn(r->subprocess_env, "ERROR_NOTES",
error_notes);
}
r->method = ap_pstrdup(r->pool, "GET");
r->method_number = M_GET;
ap_internal_redirect(custom_response, r);
return;
}
Can anyone reiterate what the reason is for forcing the redirect to be
limited to pure GETs only ?
Dw.
Re: Why force change to a GET in ErrorDocument on CGI
Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Dirk-Willem van Gulik (kim) wrote:
>
> In ap_die() we check if there is an ErrorDocument
> defined; and if so do an internal redirect;
>
> Two issues;
8< snip
> Why ? what is against a HEAD or POST for example ? Even a PUT for that
> matter.
8< snip
> Can anyone reiterate what the reason is for forcing the redirect to be
> limited to pure GETs only ?
I suspect because the semantics of the original request are no longer
known or reliable. A message-body may have been partially or completely
consumed, for instance, and therefore no longer available. That
would definitely break passing along a POST to an ErrorDocument.
--
#ken P-)}
Ken Coar <http://Web.Golux.Com/coar/>
Apache Group member <http://www.apache.org/>
"Apache Server for Dummies" <http://Web.Golux.Com/coar/ASFD/>