[BUG] ngx_http_sub_filter_module can not handle ambiguous patterns

agentzh agentzh at gmail.com
Sat Dec 29 06:04:01 UTC 2012


On Fri, Dec 28, 2012 at 5:34 AM, Maxim Dounin <mdounin at mdounin.ru> wrote:
> It's a bug, and it's expected to be fixed soon.

Thank you :)

BTW, I've also noticed that this sub filter module cannot handle
single-byte user patterns either:

    location = /t {
       default_type text/html;
        return 200 abc;
        sub_filter a X;

Accessing /t yields "abc" instead of "Xbc" (tested with Nginx 1.2.6).

The state machine in the ngx_http_sub_parse function seems to assume
that the user pattern (ctx->match) is at least 2 bytes long, which
looks incorrect to me :)

Best regards,

More information about the nginx-devel mailing list