From: Christopher Faulet Date: Mon, 24 Jul 2017 14:07:12 +0000 (+0200) Subject: MINOR: samples: Handle the type SMP_T_METH in smp_is_safe and smp_is_rw X-Git-Tag: v1.8-dev3~216 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5db105e8b2dea551a217dfb9f8fdb00c5a769332;p=thirdparty%2Fhaproxy.git 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). --- diff --git a/include/proto/sample.h b/include/proto/sample.h index 4319278a9c..94226d2d5e 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 ||