http: fix unsupported client app method 87/40887/2
authorMatus Fabian <matfabia@cisco.com>
Tue, 14 May 2024 08:04:35 +0000 (10:04 +0200)
committerFlorin Coras <florin.coras@gmail.com>
Tue, 14 May 2024 22:39:38 +0000 (22:39 +0000)
HTTP client app code currently support only GET method but method
set in message from client app was silently ignored.

Type: fix

Change-Id: I99dc6323d9783ee5a20623e7923cfdbf31474a4f
Signed-off-by: Matus Fabian <matfabia@cisco.com>
src/plugins/http/http.c

index 797be1b..893dd87 100644 (file)
@@ -824,6 +824,13 @@ http_state_wait_app_method (http_conn_t *hc, transport_send_params_t *sp)
       goto error;
     }
 
+  /* currently we support only GET method */
+  if (msg.method_type != HTTP_REQ_GET)
+    {
+      clib_warning ("unsupported method %d", msg.method_type);
+      goto error;
+    }
+
   vec_validate (buf, msg.data.len - 1);
   rv = svm_fifo_dequeue (as->tx_fifo, msg.data.len, buf);
   ASSERT (rv == msg.data.len);