From 5db105e8b2dea551a217dfb9f8fdb00c5a769332 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 24 Jul 2017 16:07:12 +0200 Subject: [PATCH] MINOR: samples: Handle the type SMP_T_METH in smp_is_safe and smp_is_rw For all known methods, samples are considered as safe and rewritable. For unknowns, we handle them like strings (SMP_T_STR). --- include/proto/sample.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/proto/sample.h b/include/proto/sample.h index 4319278..94226d2 100644 --- a/include/proto/sample.h +++ b/include/proto/sample.h @@ -86,6 +86,11 @@ static inline int smp_is_safe(struct sample *smp) { switch (smp->data.type) { + case SMP_T_METH: + if (smp->data.u.meth.meth != HTTP_METH_OTHER) + return 1; + /* Fall through */ + case SMP_T_STR: if ((smp->data.u.str.len < 0) || (smp->data.u.str.size && smp->data.u.str.len >= smp->data.u.str.size)) @@ -133,6 +138,11 @@ int smp_is_rw(struct sample *smp) return 0; switch (smp->data.type) { + case SMP_T_METH: + if (smp->data.u.meth.meth != HTTP_METH_OTHER) + return 1; + /* Fall through */ + case SMP_T_STR: if (!smp->data.u.str.size || smp->data.u.str.len < 0 || -- 1.7.10.4