From 28f5221ef0f70bd2ca5272656f2bdc68720785d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20De=20Keersmaeker?=
 <francois.dekeersmaeker@uclouvain.be>
Date: Tue, 15 Oct 2024 11:12:47 +0200
Subject: [PATCH] HTTP: do not consider HTTP request parameters

---
 http.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/http.py b/http.py
index 1487548..40e0a44 100644
--- a/http.py
+++ b/http.py
@@ -49,6 +49,13 @@ class http(Custom):
         # - URI prefix: string match with the beginning of the URI
         uri = self.protocol_data.get("uri", None)
         if uri is not None:
+            # If URI contains HTTP request parameters, remove them
+            if "?" in uri:
+                uri = uri.split("?")[0]
+                uri += "*" if not uri.endswith("*") else ""
+                self.protocol_data["uri"] = uri
+            
+            # Add URI match rule
             length = len(uri) - 1 if uri.endswith("*") or uri.endswith("$") else len(uri) + 1
             rule = {"forward": f"strncmp(http_message.uri, \"{{}}\", {length}) == 0"}
             self.add_field("uri", rule, is_backward)
-- 
GitLab