]> git.kaiwu.me - nginx.git/commit
Referer: fixed server_name regex matching.
authorSergey Kandaurov <pluknet@nginx.com>
Thu, 29 Aug 2013 18:35:26 +0000 (22:35 +0400)
committerSergey Kandaurov <pluknet@nginx.com>
Thu, 29 Aug 2013 18:35:26 +0000 (22:35 +0400)
commit8658c5b8a11c2155e66e1bd1c322099f672f7c15
treeb1525497b9412fdf11863200d980cf55fe841bf0
parent3ef0dfa145513c98b331f75730c3f16e4713cda4
Referer: fixed server_name regex matching.

The server_name regexes are normally compiled for case-sensitive matching.
This violates case-insensitive obligations in the referer module.  To fix
this, the host string is converted to lower case before matching.

Previously server_name regex was executed against the whole referer string
after dropping the scheme part.  This could led to an improper matching, e.g.:

    server_name ~^localhost$;
    valid_referers server_names;

    Referer: http://localhost/index.html

It was changed to look only at the hostname part.

The server_name regexes are separated into another array to not clash with
regular regexes.
src/http/modules/ngx_http_referer_module.c