@@ -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 ));
0 commit comments