DELETE may not have the "Depth" header
Igor Sysoev
14 years ago
105 | 105 | ngx_int_t rc; |
106 | 106 | ngx_str_t path; |
107 | 107 | ngx_file_info_t fi; |
108 | ngx_table_elt_t *depth; | |
108 | 109 | ngx_http_dav_loc_conf_t *dlcf; |
109 | 110 | |
110 | 111 | /* TODO: Win32 */ |
161 | 162 | |
162 | 163 | if (ngx_is_dir(&fi)) { |
163 | 164 | |
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)) | |
169 | 174 | { |
170 | 175 | return NGX_HTTP_BAD_REQUEST; |
171 | 176 | } |
182 | 187 | return NGX_HTTP_BAD_REQUEST; |
183 | 188 | } |
184 | 189 | |
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') | |
188 | 195 | { |
189 | 196 | return NGX_HTTP_BAD_REQUEST; |
190 | 197 | } |