On Tue, Mar 04, 2014 at 04:51:56PM +0100, Thierry FOURNIER wrote:
> The match "bin" get the configuration string "474554" and convert it as
> the binary sequence "GET". The match "str" get the configuration string
> "GET" and use it as is.
> 
> The fetch "req.payload()" returns a binary content. When you try to
> match with "str" method, the binary content is converted as string. The
> converter produce string representing hexadecimal content: "474554".
> 
> If you write 
> 
>    acl PAYLOADcheck req.payload(0,3) -m str 474554
> 
> The system works perfectly.
> 
> This behavior is not intuitive. Maybe it can be change later.

Indeed, thank you for diagnosing this. Originally we chose to cast
bin to str as hex dump because it was only used in stick tables. But
now that we support other storage and usages, it becomes less and
less natural. I think we'll change this before the final release so
that bin automatically casts to str as-is and we'll add a "tohex"
converter for people who want to explicitly convert a bin to an hex
string.

Willy


Reply via email to