1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-05 16:55:50 +03:00

PR62186: preserve %<m for ErrorDocument internal redirects

*) core: Preserve the original HTTP request method in the '%<m' LogFormat
     when an path-based ErrorDocument is used.  PR 62186.
     [Micha Lenk <micha lenk.info>]

Submitted By: Micha Lenk
Committed By: covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1828920 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Eric Covener
2018-04-11 18:49:05 +00:00
parent 5968cd3a3e
commit 5d755688b1
2 changed files with 11 additions and 1 deletions

View File

@@ -187,7 +187,8 @@ static void ap_die_r(int type, request_rec *r, int recursive_error)
apr_table_setn(r->headers_out, "Location", custom_response);
}
else if (custom_response[0] == '/') {
const char *error_notes;
const char *error_notes, *original_method;
int original_method_number;
r->no_local_copy = 1; /* Do NOT send HTTP_NOT_MODIFIED for
* error documents! */
/*
@@ -205,9 +206,14 @@ static void ap_die_r(int type, request_rec *r, int recursive_error)
"error-notes")) != NULL) {
apr_table_setn(r->subprocess_env, "ERROR_NOTES", error_notes);
}
original_method = r->method;
original_method_number = r->method_number;
r->method = "GET";
r->method_number = M_GET;
ap_internal_redirect(custom_response, r);
/* preserve ability to see %<m in the access log */
r->method = original_method;
r->method_number = original_method_number;
return;
}
else {