Set-Cookie and Content-Disposition in upstream.c

Hi.

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?

Thanks Manlio P.

On Tue, Dec 11, 2007 at 09:02:54PM +0100, Manlio P. wrote:

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

Igor S. ha scritto:

             ngx_http_upstream_copy_header_line, 0, 1 },

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 P.

Igor S. ha scritto:

So, they should to be inside headers hash with default handlers.

Thanks, I missed the redirect field.

Manlio P.

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

            ngx_http_upstream_ignore_header_line, 0,

The second fucntion processes/copies a header line from
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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs