diff options
author | Florin Coras <fcoras@cisco.com> | 2022-01-25 11:41:58 -0800 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2022-01-25 19:31:33 +0000 |
commit | 6ec81f209af854176374744d3bd1702502600f42 (patch) | |
tree | 9185acda68a1785b09bf4b6b5002d50a0d11f2de /src/plugins/hs_apps | |
parent | 5f0106a76fbc3792781a81dedb5a7e41813430d3 (diff) |
http hsa: avoid extra space in request
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I70f22350811ef3cd029d69af75659f95cc9a74c8
Diffstat (limited to 'src/plugins/hs_apps')
-rw-r--r-- | src/plugins/hs_apps/http_server.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/plugins/hs_apps/http_server.c b/src/plugins/hs_apps/http_server.c index e7d7ad34152..7a4a5194022 100644 --- a/src/plugins/hs_apps/http_server.c +++ b/src/plugins/hs_apps/http_server.c @@ -226,7 +226,7 @@ http_cli_process (vlib_main_t * vm, vlib_node_runtime_t * rt, /* Replace slashes with spaces, stop at the end of the path */ i = 0; - while (1) + while (i < vec_len (request)) { if (request[i] == '/') request[i] = ' '; @@ -237,13 +237,6 @@ http_cli_process (vlib_main_t * vm, vlib_node_runtime_t * rt, break; } i++; - /* Should never happen */ - if (i == vec_len (request)) - { - char *msg = "Bad CLI"; - vec_validate_init_c_string (html, msg, strlen (msg)); - goto send; - } } /* Generate the html header */ @@ -259,8 +252,6 @@ http_cli_process (vlib_main_t * vm, vlib_node_runtime_t * rt, html = format (html, "%v", reply); html = format (html, html_footer); -send: - /* Send it */ rpc_args = clib_mem_alloc (sizeof (*args)); clib_memcpy_fast (rpc_args, args, sizeof (*args)); |