On Wed, Apr 21, 2021 at 12:37:51AM +0200, Tim Düsterhus wrote:
> Hi
>
> On 4/21/21 12:22 AM, Maximilian Mader wrote:
> > Tim and I were talking while he was working on the URI normalizers
> > and as a fun evening exercise I decided to write a simple normalizer
> > to remove single dots from the path component.
>
> This whole series looks good to me (of course) :-)
I'm fine with this one at first glance, but I *really* think that we
need to seriously think about merging all the path* normalizers into
a single "path". There is no reason for having users iteratively pass
through multiple special cases on this. I mean, in order to normalize
a path, we'll systematically have to do this:
http-request normalize-uri path-strip-dot
http-request normalize-uri path-strip-dotdot
http-request normalize-uri path-merge-slashes
I'd rather simply do:
http-request normalize-uri path
and have all of them applied, as there's no reason for keeping that many
exceptions to the standards there when normalizing, except of course when
someone wants to fail a match :-/ Either you want the original path or you
want it normalized.
There is another one which could make sense to implement if supported by
the standard (I didn't have a look at RFC3986 recently), which is that I
don't remember if the backslash is supposed to be handled as an equivalent
to the slash, in which case it also ought to be translated.
Thanks,
Willy