summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2020-05-14 13:15:00 +0300
committerValentin Bartenev <vbart@nginx.com>2020-05-14 13:15:00 +0300
commit0174c971b5ec0d604e4e9becfa41e0bc31179e57 (patch)
tree8d0c0c41b10cc290084676aac836c1dd2313410b /src/nxt_router.c
parentd803ec39bc75622194802d249edc11fedc8e2441 (diff)
downloadunit-0174c971b5ec0d604e4e9becfa41e0bc31179e57.tar.gz
unit-0174c971b5ec0d604e4e9becfa41e0bc31179e57.tar.bz2
Configuration: URI encoding in the "pass" option.
This is useful to escape "/" in path fragments. For example, in order to reference the application named "foo/bar": { "pass": "applications/foo%2Fbar" }
Diffstat (limited to 'src/nxt_router.c')
-rw-r--r--src/nxt_router.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c
index 93b750a0..a699effc 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -1793,6 +1793,11 @@ nxt_router_conf_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf,
}
}
+ ret = nxt_http_routes_resolve(task, tmcf);
+ if (nxt_slow_path(ret != NXT_OK)) {
+ goto fail;
+ }
+
value = nxt_conf_get_path(conf, &access_log_path);
if (value != NULL) {
@@ -1827,8 +1832,6 @@ nxt_router_conf_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf,
tmcf->router_conf->access_log = access_log;
}
- nxt_http_routes_resolve(task, tmcf);
-
nxt_queue_add(&tmcf->deleting, &router->sockets);
nxt_queue_init(&router->sockets);