diff options
author | Valentin Bartenev <vbart@nginx.com> | 2019-02-27 17:25:07 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2019-02-27 17:25:07 +0300 |
commit | e929d08201aae949db25ae8c1051a91e96ba3011 (patch) | |
tree | 76af15b49cb67547dbd1942466a6bb360459fc6b /src/go/unit | |
parent | a881c31abdb9fda2ba0d2e05c45c2ce890a6cfab (diff) | |
download | unit-e929d08201aae949db25ae8c1051a91e96ba3011.tar.gz unit-e929d08201aae949db25ae8c1051a91e96ba3011.tar.bz2 |
Fixed processing of SERVER_NAME after 77aad2c142a0.
Previously, the nxt_router_prepare_msg() function expected server host among
other headers unmodified. It's not true anymore since normalization of the
Host header has been introduced in 77aad2c142a0.
The nxt_unit_split_host() function was removed. It didn't work correctly with
IPv6 literals. Anyway, after 77aad2c142a0 the port splitting is done in router
while Host header processing.
Diffstat (limited to 'src/go/unit')
-rw-r--r-- | src/go/unit/nxt_cgo_lib.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/go/unit/nxt_cgo_lib.c b/src/go/unit/nxt_cgo_lib.c index 172bef88..98a23482 100644 --- a/src/go/unit/nxt_cgo_lib.c +++ b/src/go/unit/nxt_cgo_lib.c @@ -75,14 +75,11 @@ nxt_cgo_request_handler(nxt_unit_request_info_t *req) nxt_go_request_add_header(go_req, nxt_cgo_str_init(&name, &f->name, f->name_length), nxt_cgo_str_init(&value, &f->value, f->value_length)); - - if (f->hash == NXT_UNIT_HASH_HOST) { - host = value; - } } nxt_go_request_set_content_length(go_req, r->content_length); - nxt_go_request_set_host(go_req, &host); + nxt_go_request_set_host(go_req, + nxt_cgo_str_init(&host, &r->server_name, r->server_name_length)); nxt_go_request_set_remote_addr(go_req, nxt_cgo_str_init(&remote_addr, &r->remote, r->remote_length)); |