Skip to content

Commit d21b4c4

Browse files
committed
Merge PR#419: make sure the right method is displayed.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1921973 13f79535-47bb-0310-9956-ffa450edef68
1 parent 73dc77a commit d21b4c4

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

modules/http/http_protocol.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,9 @@ static const char *get_canned_error_string(int status,
969969
{
970970
apr_pool_t *p = r->pool;
971971
const char *error_notes, *h1, *s1;
972+
const char *method = r->method;
973+
if (r->subprocess_env && apr_table_get(r->subprocess_env, "REQUEST_METHOD"))
974+
method = apr_table_get(r->subprocess_env, "REQUEST_METHOD");
972975

973976
switch (status) {
974977
case HTTP_MOVED_PERMANENTLY:
@@ -1013,7 +1016,7 @@ static const char *get_canned_error_string(int status,
10131016
case HTTP_METHOD_NOT_ALLOWED:
10141017
return(apr_pstrcat(p,
10151018
"<p>The requested method ",
1016-
ap_escape_html(r->pool, r->method),
1019+
ap_escape_html(r->pool, method),
10171020
" is not allowed for this URL.</p>\n",
10181021
NULL));
10191022
case HTTP_NOT_ACCEPTABLE:
@@ -1026,7 +1029,7 @@ static const char *get_canned_error_string(int status,
10261029
case HTTP_LENGTH_REQUIRED:
10271030
s1 = apr_pstrcat(p,
10281031
"<p>A request of the requested method ",
1029-
ap_escape_html(r->pool, r->method),
1032+
ap_escape_html(r->pool, method),
10301033
" requires a valid Content-length.<br />\n",
10311034
NULL);
10321035
return(add_optional_notes(r, s1, "error-notes", "</p>\n"));
@@ -1036,7 +1039,7 @@ static const char *get_canned_error_string(int status,
10361039
case HTTP_NOT_IMPLEMENTED:
10371040
s1 = apr_pstrcat(p,
10381041
"<p>",
1039-
ap_escape_html(r->pool, r->method),
1042+
ap_escape_html(r->pool, method),
10401043
" not supported for current URL.<br />\n",
10411044
NULL);
10421045
return(add_optional_notes(r, s1, "error-notes", "</p>\n"));
@@ -1058,7 +1061,7 @@ static const char *get_canned_error_string(int status,
10581061
case HTTP_REQUEST_ENTITY_TOO_LARGE:
10591062
return(apr_pstrcat(p,
10601063
"The requested resource does not allow request data with ",
1061-
ap_escape_html(r->pool, r->method),
1064+
ap_escape_html(r->pool, method),
10621065
" requests, or the amount of data provided in\n"
10631066
"the request exceeds the capacity limit.\n",
10641067
NULL));

modules/http/http_request.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ static void ap_die_r(int type, request_rec *r, int recursive_error)
127127
*/
128128
update_r_in_filters(r_1st_err->proto_output_filters, r, r_1st_err);
129129
update_r_in_filters(r_1st_err->input_filters, r, r_1st_err);
130+
recursive_error = type;
130131
}
131132

132133
custom_response = NULL; /* Do NOT retry the custom thing! */

0 commit comments

Comments
 (0)