summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_request.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nxt_http_request.c')
-rw-r--r--src/nxt_http_request.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nxt_http_request.c b/src/nxt_http_request.c
index f6c14df9..724b0808 100644
--- a/src/nxt_http_request.c
+++ b/src/nxt_http_request.c
@@ -367,6 +367,13 @@ nxt_http_request_application(nxt_task_t *task, nxt_http_request_t *r,
ar->r.header.method = *r->method;
}
+ if (r->host.length != 0) {
+ ar->r.header.server_name = r->host;
+
+ } else {
+ nxt_str_set(&ar->r.header.server_name, "localhost");
+ }
+
ar->r.header.target = r->target;
if (r->path != NULL) {
@@ -377,8 +384,6 @@ nxt_http_request_application(nxt_task_t *task, nxt_http_request_t *r,
ar->r.header.query = *r->args;
}
- ar->r.header.host = r->host;
-
if (r->content_type != NULL) {
ar->r.header.content_type.length = r->content_type->value_length;
ar->r.header.content_type.start = r->content_type->value;