From d18cd0f1106c923916036d69ebc0dc553b1fcff8 Mon Sep 17 00:00:00 2001 From: Thierry FOURNIER Date: Fri, 29 Nov 2013 12:15:45 +0100 Subject: [PATCH] MEDIUM: http: The redirect strings follows the log format rules. We handle "http-request redirect" with a log-format string now, but we leave "redirect" unaffected. Note that the control of the special "/" case is move from the runtime execution to the configuration parsing. If the format rule list is empty, the build_logline() function does nothing. --- doc/configuration.txt | 20 +++++-- include/proto/proto_http.h | 4 +- include/types/arg.h | 1 + include/types/proxy.h | 1 + src/cfgparse.c | 2 +- src/haproxy.c | 4 ++ src/log.c | 2 + src/proto_http.c | 108 +++++++++++++++++++++++++++---------- src/sample.c | 1 + 9 files changed, 108 insertions(+), 35 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index b2ef7e349..803d42edc 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -2768,7 +2768,8 @@ http-request { allow | deny | tarpit | auth [realm ] | redirect | - "redirect" : this performs an HTTP redirection based on a redirect rule. This is exactly the same as the "redirect" statement except that it inserts a redirect rule which can be processed in the middle of other - "http-request" rules. See the "redirect" keyword for the rule's syntax. + "http-request" rules and that these rules use the "log-format" strings. + See the "redirect" keyword for the rule's syntax. - "add-header" appends an HTTP header field whose name is specified in and whose value is defined by which follows the log-format @@ -4709,14 +4710,19 @@ redirect scheme [code ]