diff options
author | Valentin Bartenev <vbart@nginx.com> | 2018-04-11 18:23:58 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2018-04-11 18:23:58 +0300 |
commit | c610b356497136f11c7c8d7dc3d28c29a9a76cd4 (patch) | |
tree | a5532bba14aef5bee40165d4d3a01e6c736160b2 /src/nxt_controller.c | |
parent | da61cfd98b19903d54d4d54750c2ab375b0da76f (diff) | |
download | unit-c610b356497136f11c7c8d7dc3d28c29a9a76cd4.tar.gz unit-c610b356497136f11c7c8d7dc3d28c29a9a76cd4.tar.bz2 |
Controller: added "/config" prefix for the configuration object.
Diffstat (limited to 'src/nxt_controller.c')
-rw-r--r-- | src/nxt_controller.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nxt_controller.c b/src/nxt_controller.c index d1d8efbf..0fca81b6 100644 --- a/src/nxt_controller.c +++ b/src/nxt_controller.c @@ -769,6 +769,17 @@ nxt_controller_process_request(nxt_task_t *task, nxt_controller_request_t *req) c = req->conn; path = req->parser.path; + if (nxt_str_start(&path, "/config", 7)) { + + if (path.length == 7) { + path.length = 1; + + } else if (path.start[7] == '/') { + path.length -= 7; + path.start += 7; + } + } + if (path.length > 1 && path.start[path.length - 1] == '/') { path.length--; } |