]> git.kaiwu.me - nginx.git/commit
Apply server configuration as soon as host is known.
authorValentin Bartenev <vbart@nginx.com>
Wed, 27 Feb 2013 17:27:15 +0000 (17:27 +0000)
committerValentin Bartenev <vbart@nginx.com>
Wed, 27 Feb 2013 17:27:15 +0000 (17:27 +0000)
commit8c4fea17667d63a70e09571e0aa18551765c24c3
tree75aa4ec9e983a8021140d978988b8a275d239594
parentd281d0ba8b779b591e96ef237ff149e3d521264f
Apply server configuration as soon as host is known.

Previously, this was done only after the whole request header
was parsed, and if an error occurred earlier then the request
was processed in the default server (or server chosen by SNI),
while r->headers_in.server might be set to the value from the
Host: header or host from request line.

r->headers_in.server is in turn used for $host variable and
in HTTP redirects if "server_name_in_redirect" is disabled.
Without the change, configurations that rely on this during
error handling are potentially unsafe if SNI is used.

This change also allows to use server specific settings of
"underscores_in_headers", "ignore_invalid_headers", and
"large_client_header_buffers" directives for HTTP requests
and HTTPS requests without SNI.
src/http/ngx_http_request.c