Klaus Demo nginx / 6bff9c9
Dav: fixed ngx_copy_file() to truncate destination file. Previously, ngx_open_file(NGX_FILE_CREATE_OR_OPEN) was used, resulting in destination file being partially rewritten if exists. Notably, this affected WebDAV COPY command (ticket #1576). Maxim Dounin 3 years ago
1 changed file(s) with 1 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
838838 goto failed;
839839 }
840840
841 nfd = ngx_open_file(to, NGX_FILE_WRONLY, NGX_FILE_CREATE_OR_OPEN,
842 cf->access);
841 nfd = ngx_open_file(to, NGX_FILE_WRONLY, NGX_FILE_TRUNCATE, cf->access);
843842
844843 if (nfd == NGX_INVALID_FILE) {
845844 ngx_log_error(NGX_LOG_CRIT, cf->log, ngx_errno,