mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 11:16:33 +03:00
More cleanup of error messages and marking as relevant. See #4.
This commit is contained in:
@@ -20,14 +20,20 @@ apr_status_t send_error_bucket(modsec_rec *msr, ap_filter_t *f, int status) {
|
||||
apr_bucket_brigade *brigade = NULL;
|
||||
apr_bucket *bucket = NULL;
|
||||
|
||||
/* Force relevancy for all errors */
|
||||
if (msr != NULL) {
|
||||
msr->is_relevant++;
|
||||
}
|
||||
|
||||
/* Set the status line explicitly for the error document */
|
||||
f->r->status_line = ap_get_status_line(status);
|
||||
|
||||
/* Force alert log for any errors that are not already marked relevant
|
||||
* to prevent any missing error messages in the code from going
|
||||
* unnoticed. To prevent this error, all code should either set
|
||||
* is_relevant, or just use msr_log with a level <= 3 prior to
|
||||
* calling this function.
|
||||
*/
|
||||
if ((msr != NULL) && (msr->is_relevant == 0)) {
|
||||
msr_log(msr, 1, "Internal error: Issuing \"%s\" for unspecified error.",
|
||||
f->r->status_line);
|
||||
}
|
||||
|
||||
brigade = apr_brigade_create(f->r->pool, f->r->connection->bucket_alloc);
|
||||
if (brigade == NULL) return APR_EGENERAL;
|
||||
|
||||
|
Reference in New Issue
Block a user