[dev] Set-Cookie and Content-Disposition in upstream.c

Manlio Perillo manlio_perillo at libero.it
Wed Dec 12 14:01:23 MSK 2007


Igor Sysoev ha scritto:
> On Tue, Dec 11, 2007 at 09:02:54PM +0100, Manlio Perillo wrote:
> 
>> I'm not sure to understand this code in ngx_http_upstream.c:
>>
>>     { ngx_string("Set-Cookie"),
>>                  ngx_http_upstream_ignore_header_line, 0,
>>                  ngx_http_upstream_copy_header_line, 0, 1 },
>>
>>     { ngx_string("Content-Disposition"),
>>                  ngx_http_upstream_ignore_header_line, 0,
>>                  ngx_http_upstream_copy_header_line, 0, 1 },
>>
>>
>> Isn't this code superfluous?
> 
> The first function processes specially a header line just after
> it is copyed to r->upstream->headers_in
> 
> ngx_http_upstream_ignore_header_line() does nothing special
> 
> The second fucntion processes/copies a header line from
> r->upstream->headers_in to r->headers_out
> 
> 

Ok, but isn't this done for the generic headers?

         if (hh) {
             if (hh->copy_handler(r, &h[i], hh->conf) != NGX_OK) {
                 ngx_http_upstream_finalize_request(r, u,
 
NGX_HTTP_INTERNAL_SERVER_ERROR);
                 return;
             }

             continue;
         }

         if (ngx_http_upstream_copy_header_line(r, &h[i], 0) != NGX_OK) {
             ngx_http_upstream_finalize_request(r, u,
 
NGX_HTTP_INTERNAL_SERVER_ERROR);
             return;
         }



Thanks  Manlio Perillo





More information about the nginx mailing list