Klaus Demo nginx / 9aaf256
Referer module: fixed regex matching against HTTPS referers. When matching a compiled regex against value in the "Referer" header field, the length was calculated incorrectly for strings that start from "https://". This might cause matching to fail for regexes with end-of-line anchors. Patch by Liangbin Li. Sergey Kandaurov 8 years ago
1 changed file(s) with 3 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
146146
147147 if (ngx_strncasecmp(ref, (u_char *) "http://", 7) == 0) {
148148 ref += 7;
149 len -= 7;
149150 goto valid_scheme;
150151
151152 } else if (ngx_strncasecmp(ref, (u_char *) "https://", 8) == 0) {
152153 ref += 8;
154 len -= 8;
153155 goto valid_scheme;
154156 }
155157 }
190192 ngx_int_t rc;
191193 ngx_str_t referer;
192194
193 referer.len = len - 7;
195 referer.len = len;
194196 referer.data = ref;
195197
196198 rc = ngx_regex_exec_array(rlcf->regex, &referer, r->connection->log);