MINOR: uri_normalizer: Add a `dotdot` normalizer to http-request normalize-uri
This normalizer merges `../` path segments with the predecing segment, removing
both the preceding segment and the `../`.
Empty segments do not receive special treatment. The `merge-slashes` normalizer
should be executed first.
See GitHub Issue #714.
diff --git a/doc/configuration.txt b/doc/configuration.txt
index 4dec9c8..4b6e63d 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -6012,11 +6012,24 @@
See RFC 8297 for more information.
http-request normalize-uri <normalizer> [ { if | unless } <condition> ]
+http-request normalize-uri dotdot [ { if | unless } <condition> ]
http-request normalize-uri merge-slashes [ { if | unless } <condition> ]
Performs normalization of the request's URI. The following normalizers are
available:
+ - dotdot: Normalizes "/../" segments within the "path" component. This merges
+ segments that attempt to access the parent directory with their preceding
+ segment. Empty segments do not receive special treatment. Use the
+ "merge-slashes" normalizer first if this is undesired.
+
+ Example:
+ - /foo/../ -> /
+ - /foo/../bar/ -> /bar/
+ - /foo/bar/../ -> /foo/
+ - /../bar/ -> /../bar/
+ - /foo//../ -> /foo/
+
- merge-slashes: Merges adjacent slashes within the "path" component into a
single slash.