Controller: added "/config" prefix for the configuration object.

This commit is contained in:
Valentin Bartenev
2018-04-11 18:23:58 +03:00
parent da61cfd98b
commit c610b35649

View File

@@ -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--;
}