EastCoast_16835
Dec 03, 2015Nimbostratus
Rewriting response with STREAM not working properly
Hello,
I am developping an iRule to rewrite a response from the Web server.
I need to rewrite a chain of characters AND its length specified in the first character as a hex value.
The iRule works well except the part that rewrites the hexadecimal value of the length.
Code
STREAM::disable
STREAM::expression {@\x3Chttp://something1@\x17http://something2@}
STREAM::enable
Where
\x3C is the length of the original string
\x17 is the length of the replacement string
As a result, \x3C is interpreted correctly as an hex caracter ('<' ascii) but \x17 is interpreted as a string of characters.
So I am getting this byte sequence:
5C 78 31 37 68 74 74 70 3A 2F 2F ... -> \x17http:// ...
Instead of expected one:
17 68 74 74 70 3A 2F 2F ... -> .http:// ...
Is it a bug in the STREAM instruction or I am doing something wrong?
Thank you