@@ -963,6 +963,9 @@ static const char *get_canned_error_string(int status,
963
963
{
964
964
apr_pool_t * p = r -> pool ;
965
965
const char * error_notes , * h1 , * s1 ;
966
+ const char * method = r -> method ;
967
+ if (r -> subprocess_env && apr_table_get (r -> subprocess_env , "REQUEST_METHOD" ))
968
+ method = apr_table_get (r -> subprocess_env , "REQUEST_METHOD" );
966
969
967
970
switch (status ) {
968
971
case HTTP_MOVED_PERMANENTLY :
@@ -1007,7 +1010,7 @@ static const char *get_canned_error_string(int status,
1007
1010
case HTTP_METHOD_NOT_ALLOWED :
1008
1011
return (apr_pstrcat (p ,
1009
1012
"<p>The requested method " ,
1010
- ap_escape_html (r -> pool , r -> method ),
1013
+ ap_escape_html (r -> pool , method ),
1011
1014
" is not allowed for this URL.</p>\n" ,
1012
1015
NULL ));
1013
1016
case HTTP_NOT_ACCEPTABLE :
@@ -1020,7 +1023,7 @@ static const char *get_canned_error_string(int status,
1020
1023
case HTTP_LENGTH_REQUIRED :
1021
1024
s1 = apr_pstrcat (p ,
1022
1025
"<p>A request of the requested method " ,
1023
- ap_escape_html (r -> pool , r -> method ),
1026
+ ap_escape_html (r -> pool , method ),
1024
1027
" requires a valid Content-length.<br />\n" ,
1025
1028
NULL );
1026
1029
return (add_optional_notes (r , s1 , "error-notes" , "</p>\n" ));
@@ -1030,7 +1033,7 @@ static const char *get_canned_error_string(int status,
1030
1033
case HTTP_NOT_IMPLEMENTED :
1031
1034
s1 = apr_pstrcat (p ,
1032
1035
"<p>" ,
1033
- ap_escape_html (r -> pool , r -> method ),
1036
+ ap_escape_html (r -> pool , method ),
1034
1037
" not supported for current URL.<br />\n" ,
1035
1038
NULL );
1036
1039
return (add_optional_notes (r , s1 , "error-notes" , "</p>\n" ));
@@ -1052,7 +1055,7 @@ static const char *get_canned_error_string(int status,
1052
1055
case HTTP_REQUEST_ENTITY_TOO_LARGE :
1053
1056
return (apr_pstrcat (p ,
1054
1057
"The requested resource does not allow request data with " ,
1055
- ap_escape_html (r -> pool , r -> method ),
1058
+ ap_escape_html (r -> pool , method ),
1056
1059
" requests, or the amount of data provided in\n"
1057
1060
"the request exceeds the capacity limit.\n" ,
1058
1061
NULL ));
0 commit comments