MINOR: uri_normalizer: Add a strip-dot normalizer

This normalizer removes "/./" segments from the path component.
Usually the dot refers to the current directory which renders those segments redundant.

See GitHub Issue #714.
This commit is contained in:
Maximilian Mader
2021-04-21 00:22:50 +02:00
committed by Christopher Faulet
parent c9c79570d4
commit ff3bb8b609
6 changed files with 154 additions and 1 deletions

View File

@@ -103,6 +103,7 @@ enum act_timeout_name {
enum act_normalize_uri {
ACT_NORMALIZE_URI_PATH_MERGE_SLASHES,
ACT_NORMALIZE_URI_PATH_STRIP_DOT,
ACT_NORMALIZE_URI_PATH_STRIP_DOTDOT,
ACT_NORMALIZE_URI_PATH_STRIP_DOTDOT_FULL,
ACT_NORMALIZE_URI_QUERY_SORT_BY_NAME,

View File

@@ -19,6 +19,7 @@
#include <haproxy/uri_normalizer-t.h>
enum uri_normalizer_err uri_normalizer_percent_upper(const struct ist input, int strict, struct ist *dst);
enum uri_normalizer_err uri_normalizer_path_dot(const struct ist path, struct ist *dst);
enum uri_normalizer_err uri_normalizer_path_dotdot(const struct ist path, int full, struct ist *dst);
enum uri_normalizer_err uri_normalizer_path_merge_slashes(const struct ist path, struct ist *dst);
enum uri_normalizer_err uri_normalizer_query_sort(const struct ist query, const char delim, struct ist *dst);