Mercurial > hg > nginx-quic
comparison src/http/ngx_http_variables.c @ 2092:65cff41e9a4e stable-0.6
r2008 merge:
*) host in request line has priority
*) allow several Host headers
*) validate host
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 07 Jul 2008 10:22:30 +0000 |
parents | 0d9c6fe7502b |
children | b56d4b1ebac7 |
comparison
equal
deleted
inserted
replaced
2091:9f15e5f8ff9e | 2092:65cff41e9a4e |
---|---|
710 ngx_http_variable_host(ngx_http_request_t *r, ngx_http_variable_value_t *v, | 710 ngx_http_variable_host(ngx_http_request_t *r, ngx_http_variable_value_t *v, |
711 uintptr_t data) | 711 uintptr_t data) |
712 { | 712 { |
713 ngx_http_core_srv_conf_t *cscf; | 713 ngx_http_core_srv_conf_t *cscf; |
714 | 714 |
715 if (r->host_start == NULL) { | 715 if (r->headers_in.server.len) { |
716 | 716 v->len = r->headers_in.server.len; |
717 if (r->headers_in.host) { | 717 v->data = r->headers_in.server.data; |
718 v->len = r->headers_in.host_name_len; | |
719 v->data = r->headers_in.host->value.data; | |
720 | |
721 } else { | |
722 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); | |
723 | |
724 v->len = cscf->server_name.len; | |
725 v->data = cscf->server_name.data; | |
726 } | |
727 | |
728 } else if (r->host_end) { | |
729 v->len = r->host_end - r->host_start; | |
730 v->data = r->host_start; | |
731 | 718 |
732 } else { | 719 } else { |
733 v->not_found = 1; | 720 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); |
734 return NGX_OK; | 721 |
722 v->len = cscf->server_name.len; | |
723 v->data = cscf->server_name.data; | |
735 } | 724 } |
736 | 725 |
737 v->valid = 1; | 726 v->valid = 1; |
738 v->no_cacheable = 0; | 727 v->no_cacheable = 0; |
739 v->not_found = 0; | 728 v->not_found = 0; |