Oh, never mind. This is fixed in recent nginx version.<br><br><div class="gmail_quote">On Tue, Mar 19, 2013 at 2:11 PM, Dmitry Petrov <span dir="ltr"><<a href="mailto:dmitry.petroff@gmail.com" target="_blank">dmitry.petroff@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello<br><br>I was trying to add some custom headers via add_header directive to webdav response and run into the problem: if response code was 201 (file created), then custom headers weren't added. The reason in that big if statement in ngx_http_headers_filter doesn't check for NGX_HTTP_CREATED. Is it intended behavior that custom headers aren't added to 201 responses?<br>

<br>If we want to add headers to any 2xx response, then why just don't change<br><div style="margin-left:40px;font-family:courier new,monospace">    if ((conf->expires == NGX_HTTP_EXPIRES_OFF && conf->headers == NULL)<br>

        || r != r->main<br>        || (r->headers_out.status != NGX_HTTP_OK<br>            && r->headers_out.status != NGX_HTTP_CREATED<br>            && r->headers_out.status != NGX_HTTP_NO_CONTENT<br>

            && r->headers_out.status != NGX_HTTP_PARTIAL_CONTENT<br>            && r->headers_out.status != NGX_HTTP_MOVED_PERMANENTLY<br>            && r->headers_out.status != NGX_HTTP_MOVED_TEMPORARILY<br>

            && r->headers_out.status != NGX_HTTP_SEE_OTHER<br>            && r->headers_out.status != NGX_HTTP_NOT_MODIFIED<br>            && r->headers_out.status != NGX_HTTP_TEMPORARY_REDIRECT))<br>

    {<br>        return ngx_http_next_header_filter(r);<br>    }<br></div>to<br><div style="margin-left:40px"><span style="font-family:courier new,monospace">    if ((conf->expires == NGX_HTTP_EXPIRES_OFF && conf->headers == NULL)</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">
        || r != r->main</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">
        || r->headers_out.status / 100 != 2)</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">    {</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">
        return ngx_http_next_header_filter(r);</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">
    }</span><span class="HOEnZb"><font color="#888888"><br>
</font></span></div><span class="HOEnZb"><font color="#888888"><br>-- <br>Regards,<br>Dmitry<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Dmitry<br>