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

Igor Sysoev is at rambler-co.ru
Wed Dec 12 14:17:00 MSK 2007


On Wed, Dec 12, 2007 at 12:01:23PM +0100, Manlio Perillo wrote:

> 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;
>         }

Yes, but these headers are not generic, they have the "redirect" field set.
So, they should to be inside headers hash with default handlers.


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list