From c610b356497136f11c7c8d7dc3d28c29a9a76cd4 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Wed, 11 Apr 2018 18:23:58 +0300 Subject: [PATCH] Controller: added "/config" prefix for the configuration object. --- src/nxt_controller.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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--; }