summaryrefslogtreecommitdiffstats
path: root/src/plugins/hs_apps/http_cli.c
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2024-05-10 16:20:40 +0200
committerFlorin Coras <florin.coras@gmail.com>2024-05-14 22:36:31 +0000
commitb7a9ed75fbce1e5e69441916a14235b3a1403593 (patch)
treecae379207e9315484245f869332adc8d2bc60a82 /src/plugins/hs_apps/http_cli.c
parent182d8b2ddba098f99029ed82e44960f3dfd18987 (diff)
http: fix server sending all status codes
Type: fix Change-Id: I4bc748e3091c2fbe0142d1b74d21a543a62c4ce0 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/hs_apps/http_cli.c')
-rw-r--r--src/plugins/hs_apps/http_cli.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/hs_apps/http_cli.c b/src/plugins/hs_apps/http_cli.c
index 5d4d49c0fba..f42f65342c3 100644
--- a/src/plugins/hs_apps/http_cli.c
+++ b/src/plugins/hs_apps/http_cli.c
@@ -323,6 +323,13 @@ hcs_ts_rx_callback (session_t *ts)
return 0;
}
+ if (msg.data.len == 0)
+ {
+ hs->tx_buf = 0;
+ start_send_data (hs, HTTP_STATUS_BAD_REQUEST);
+ return 0;
+ }
+
/* send the command to a new/recycled vlib process */
vec_validate (args.buf, msg.data.len - 1);
rv = svm_fifo_dequeue (ts->rx_fifo, msg.data.len, args.buf);