diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2013-09-23 19:37:13 +0400 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2013-09-23 19:37:13 +0400 |
commit | e11584164f787095e99e6759f2f6e16e24683855 (patch) | |
tree | a09603e9e0a7e702f853027ef71a3b0772098343 /src/core/ngx_string.h | |
parent | d2ef70e97acbda42204d589d0886be88314016c2 (diff) | |
download | nginx-e11584164f787095e99e6759f2f6e16e24683855.tar.gz nginx-e11584164f787095e99e6759f2f6e16e24683855.zip |
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.
Diffstat (limited to 'src/core/ngx_string.h')
-rw-r--r-- | src/core/ngx_string.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/ngx_string.h b/src/core/ngx_string.h index 92d246ebc..99bdbda6f 100644 --- a/src/core/ngx_string.h +++ b/src/core/ngx_string.h @@ -167,6 +167,7 @@ ngx_int_t ngx_rstrncmp(u_char *s1, u_char *s2, size_t n); ngx_int_t ngx_rstrncasecmp(u_char *s1, u_char *s2, size_t n); ngx_int_t ngx_memn2cmp(u_char *s1, u_char *s2, size_t n1, size_t n2); ngx_int_t ngx_dns_strcmp(u_char *s1, u_char *s2); +ngx_int_t ngx_filename_cmp(u_char *s1, u_char *s2, size_t n); ngx_int_t ngx_atoi(u_char *line, size_t n); ngx_int_t ngx_atofp(u_char *line, size_t n, size_t point); |