<div dir="ltr">Hello Valentin,<div><br></div><div>I understand that the "<b>complete</b>" handling of the 204 & 304 response is not same, but it is same for below mentioned response headers received by downstream client</div><div><br></div><div>Quote for handling of "Content-Type", "Content-Length", "Last-Modified" header from <span style="font-size:12.7272720336914px;color:rgb(80,0,80)">ngx_http_header_filter_module.</span><span style="font-size:12.7272720336914px;color:rgb(80,0,80)">c::ngx_http_header_filter()</span></div><div><div>    /* clear out CL/CT header for header only 204/304 response</div><div>       earlier it was done only for 204/304 generated by nginx</div><div>       making it common for both paths - when nginx is serving the response</div><div>       and when the response is generated from the upstream */</div><div>    if (r->headers_out.status == NGX_HTTP_NO_CONTENT</div><div>        || r->headers_out.status == NGX_HTTP_NOT_MODIFIED) {</div><div>      r->header_only = 1;</div><div>      ngx_str_null(&r->headers_out.content_type);</div><div>      r->headers_out.last_modified_time = -1;</div><div>      r->headers_out.last_modified = NULL;</div><div>      r->headers_out.content_length = NULL;</div><div>      r->headers_out.content_length_n = -1;</div><div>    }</div></div><div><br></div><div>---</div><div><br></div><div>After this "<b>common</b>" handling for 204 & 304 responses, specific handling of 204/304 come in effect.</div><div><br></div><div>I wanted to achieve this "<b>common</b>" handling through the patch I submitted. I think the patch is correct and should be incorporated.<br></div><div><br></div><div><div>Without the patch, SPDY 304 responses will have "Content-Length", "Content-Type" header (which is not present in non-SPDY 304 response).</div><div><br></div></div><div>Let me know if I am not being clear here.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 25, 2014 at 8:04 PM, Valentin V. Bartenev <span dir="ltr"><<a href="mailto:vbart@nginx.com" target="_blank">vbart@nginx.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thursday 25 December 2014 09:34:16 Shrirang Ballal wrote:<br>
> 304 handling for non-spdy requests is exactly same as that of 204 handling<br>
> (Reference : ngx_http_header_filter_module.c::ngx_http_header_filter()).<br>
> SPDY requests too should be handled same way.<br>
</span>[..]<br>
<br>
Well, they are not handled the same way.<br>
<br>
A quote from the function you mentioned:<br>
<br>
        if (status >= NGX_HTTP_OK<br>
            && status < NGX_HTTP_LAST_2XX)<br>
        {<br>
            /* 2XX */<br>
<br>
            if (status == NGX_HTTP_NO_CONTENT) {<br>
<span class="">                r->header_only = 1;<br>
                ngx_str_null(&r->headers_out.content_type);<br>
</span>                r->headers_out.last_modified_time = -1;<br>
                r->headers_out.last_modified = NULL;<br>
                r->headers_out.content_length = NULL;<br>
                r->headers_out.content_length_n = -1;<br>
            }<br>
<br>
            status -= NGX_HTTP_OK;<br>
            status_line = &ngx_http_status_lines[status];<br>
            len += ngx_http_status_lines[status].len;<br>
<br>
        } else if (status >= NGX_HTTP_MOVED_PERMANENTLY<br>
                   && status < NGX_HTTP_LAST_3XX)<br>
        {<br>
            /* 3XX */<br>
<br>
            if (status == NGX_HTTP_NOT_MODIFIED) {<br>
                r->header_only = 1;<br>
            }<br>
<br>
            status = status - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_OFF_3XX;<br>
            status_line = &ngx_http_status_lines[status];<br>
            len += ngx_http_status_lines[status].len;<br>
<br>
        }<br>
<br>
<br>
<br>
  wbr, Valentin V. Bartenev<br>
<br>
_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br>
</blockquote></div><br></div>