]> git.kaiwu.me - nginx.git/commit
Added ngx_filename_cmp() with "/" sorted to the left.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 23 Sep 2013 15:37:13 +0000 (19:37 +0400)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 23 Sep 2013 15:37:13 +0000 (19:37 +0400)
commite11584164f787095e99e6759f2f6e16e24683855
treea09603e9e0a7e702f853027ef71a3b0772098343
parentd2ef70e97acbda42204d589d0886be88314016c2
Added ngx_filename_cmp() with "/" sorted to the left.

This patch fixes incorrect handling of auto redirect in configurations
like:

    location /0  { }
    location /a- { }
    location /a/ { proxy_pass ... }

With previously used sorting, this resulted in the following locations
tree (as "-" is less than "/"):

        "/a-"
    "/0"    "/a/"

and a request to "/a" didn't match "/a/" with auto_redirect, as it
didn't traverse relevant tree node during lookup (it tested "/a-",
then "/0", and then falled back to null location).

To preserve locale use for non-ASCII characters on case-insensetive
systems, libc's tolower() used.
src/core/ngx_string.c
src/core/ngx_string.h
src/os/unix/ngx_darwin_config.h
src/os/unix/ngx_files.h
src/os/unix/ngx_freebsd_config.h
src/os/unix/ngx_linux_config.h
src/os/unix/ngx_posix_config.h
src/os/unix/ngx_solaris_config.h
src/os/win32/ngx_files.h
src/os/win32/ngx_win32_config.h