Klaus Demo nginx / acbcd9d
DELETE may not have the "Depth" header Igor Sysoev 14 years ago
1 changed file(s) with 15 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
105105 ngx_int_t rc;
106106 ngx_str_t path;
107107 ngx_file_info_t fi;
108 ngx_table_elt_t *depth;
108109 ngx_http_dav_loc_conf_t *dlcf;
109110
110111 /* TODO: Win32 */
161162
162163 if (ngx_is_dir(&fi)) {
163164
164 if (r->uri.data[r->uri.len - 1] != '/'
165 || r->headers_in.depth == NULL
166 || r->headers_in.depth->value.len != sizeof("infinity") - 1
167 || ngx_strcmp(r->headers_in.depth->value.data, "infinity")
168 != 0)
165 if (r->uri.data[r->uri.len - 1] != '/') {
166 return NGX_HTTP_BAD_REQUEST;
167 }
168
169 depth = r->headers_in.depth;
170
171 if (depth
172 && (depth->value.len != sizeof("infinity") - 1
173 || ngx_strcmp(depth->value.data, "infinity") != 0))
169174 {
170175 return NGX_HTTP_BAD_REQUEST;
171176 }
182187 return NGX_HTTP_BAD_REQUEST;
183188 }
184189
185 if (r->headers_in.depth
186 && r->headers_in.depth->value.len == 1
187 && r->headers_in.depth->value.data[0] == '1')
190 depth = r->headers_in.depth;
191
192 if (depth
193 && depth->value.len == 1
194 && depth->value.data[0] == '1')
188195 {
189196 return NGX_HTTP_BAD_REQUEST;
190197 }