On 09. 01. 2025. 13:22, Chris Hibbert wrote:
> Well my first contribution is off to an embarrassing start, here is the
> proposed patch attached!
>
Hello Chris,
I would just like to comment on the part of your patch related to
addons/ot/src/util.c:
I think that instead of HTTP_METH_PATCH, the string content "PATCH" (that is,
HTTP_METH_STR_PATCH which is defined as "PATCH") should be used, and not an
enum as you have.
An example of that part of the patch is in the attachment.
Best regards,
--
Miroslav Zagorac
diff --git a/addons/ot/include/util.h b/addons/ot/include/util.h
index 776ddd203..f5739b2a8 100644
--- a/addons/ot/include/util.h
+++ b/addons/ot/include/util.h
@@ -23,6 +23,7 @@
#define HTTP_METH_STR_OPTIONS "OPTIONS"
#define HTTP_METH_STR_GET "GET"
#define HTTP_METH_STR_HEAD "HEAD"
+#define HTTP_METH_STR_PATCH "PATCH"
#define HTTP_METH_STR_POST "POST"
#define HTTP_METH_STR_PUT "PUT"
#define HTTP_METH_STR_DELETE "DELETE"
diff --git a/addons/ot/src/util.c b/addons/ot/src/util.c
index fd040164d..4689fbf03 100644
--- a/addons/ot/src/util.c
+++ b/addons/ot/src/util.c
@@ -585,6 +585,11 @@ int flt_ot_sample_to_str(const struct sample_data *data, char *value, size_t siz
(void)memcpy(value, HTTP_METH_STR_HEAD, retval + 1);
}
+ else if (data->u.meth.meth == HTTP_METH_PATCH) {
+ retval = FLT_OT_STR_SIZE(HTTP_METH_STR_PATCH);
+
+ (void)memcpy(value, HTTP_METH_STR_PATCH, retval + 1);
+ }
else if (data->u.meth.meth == HTTP_METH_POST) {
retval = FLT_OT_STR_SIZE(HTTP_METH_STR_POST);