[PATCH 04 of 14] Reset c->log->action on redirect to a named location
Maxim Dounin
mdounin at mdounin.ru
Sat Apr 20 00:59:52 UTC 2024
# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1713574632 -10800
# Sat Apr 20 03:57:12 2024 +0300
# Node ID e59f07d8682810caa6693f707928593651fb9038
# Parent c485429c713b5d24ba8329e95164b517cf8a1b87
Reset c->log->action on redirect to a named location.
This matches what happens on internal redirects in ngx_http_handler(), and
ensures that stale log actions, such as "sending to client" from the upstream
module, are not used after an error_page redirection to a named location.
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -2596,6 +2596,8 @@ ngx_http_named_location(ngx_http_request
"using location: %V \"%V?%V\"",
name, &r->uri, &r->args);
+ r->connection->log->action = NULL;
+
r->internal = 1;
r->content_handler = NULL;
r->uri_changed = 0;
More information about the nginx-devel
mailing list