From 9ad0ebc956f4317111c12e2c5428acd18522f025 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Thu, 15 Sep 2022 12:05:36 -0400 Subject: caddyhttp: Add 'skip_log' var to omit request from logs (#4691) * caddyhttp: Implement `skip_log` handler * Refactor to use vars middleware Co-authored-by: Matt Holt --- .../caddyfile_adapt/log_except_catchall_blocks.txt | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'caddytest') diff --git a/caddytest/integration/caddyfile_adapt/log_except_catchall_blocks.txt b/caddytest/integration/caddyfile_adapt/log_except_catchall_blocks.txt index 57b63af..ed3b20d 100644 --- a/caddytest/integration/caddyfile_adapt/log_except_catchall_blocks.txt +++ b/caddytest/integration/caddyfile_adapt/log_except_catchall_blocks.txt @@ -1,5 +1,7 @@ http://localhost:2020 { log + skip_log /first-hidden* + skip_log /second-hidden* respond 200 } @@ -28,6 +30,36 @@ http://localhost:2020 { { "handler": "subroute", "routes": [ + { + "handle": [ + { + "handler": "vars", + "skip_log": true + } + ], + "match": [ + { + "path": [ + "/second-hidden*" + ] + } + ] + }, + { + "handle": [ + { + "handler": "vars", + "skip_log": true + } + ], + "match": [ + { + "path": [ + "/first-hidden*" + ] + } + ] + }, { "handle": [ { -- cgit v1.2.3