From 747d6f550fa8b55f27cb09e2ed1931c7736a6b11 Mon Sep 17 00:00:00 2001 From: Nicolai Dagestad Date: Wed, 12 Jul 2023 15:51:51 +0200 Subject: [PATCH] Add comment about the url replacement bug --- TODO | 5 +++++ main.go | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/TODO b/TODO index 6fc918f..f18b29e 100644 --- a/TODO +++ b/TODO @@ -27,8 +27,13 @@ BUG: * Also happens when there are tabs in the data ? * Investigate to really understand why this kind of input crashes the hanlder * Somehow I must detect if the data is something I can hanlde or not probably + * If a path contains a non-existant directory, get_mime_type will segfault + * the url should be rewritten only if the MatchExpression is true. + If a filter matches, but another condition makes the MatchExpression false + the url should not be replaced by the result from the filter + diff --git a/main.go b/main.go index d973c86..0a38204 100644 --- a/main.go +++ b/main.go @@ -285,6 +285,10 @@ func handle_uri(raw_url string, config *Config) { } filter_handler := func(filter string) { + // FIXME: url should be rewritten only if the MatchExpression is true. + // If a filter matches, but another condition makes the MatchExpression false + // the url should not be replaced by the result from the filter + //TODO: support arguments for filters? match, new_url := run_filter(filter, url, config, handler) if match { -- 2.45.2