Klaus Demo nginx / ce8183c
merge r3460: allow HTTPS referers Igor Sysoev 9 years ago
1 changed file(s) with 21 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
123123 len = r->headers_in.referer->value.len;
124124 ref = r->headers_in.referer->value.data;
125125
126 if (len < sizeof("http://i.ru") - 1
127 || (ngx_strncasecmp(ref, (u_char *) "http://", 7) != 0))
128 {
129 if (rlcf->blocked_referer) {
130 goto valid;
131 }
132
133 goto invalid;
134 }
135
136 last = ref + len;
137 ref += 7;
126 if (len >= sizeof("http://i.ru") - 1) {
127 last = ref + len;
128
129 if (ngx_strncasecmp(ref, (u_char *) "http://", 7) == 0) {
130 ref += 7;
131 goto valid_scheme;
132
133 } else if (ngx_strncasecmp(ref, (u_char *) "https://", 8) == 0) {
134 ref += 8;
135 goto valid_scheme;
136 }
137 }
138
139 if (rlcf->blocked_referer) {
140 goto valid;
141 }
142
143 goto invalid;
144
145 valid_scheme:
146
138147 i = 0;
139148 key = 0;
140149