Forum Discussion
den_39838
Nimbostratus
May 16, 2010Binary (HEX) payload replace in HTTP
Trying to write simple iRule to replace 2 bytes in HTTP response data.
===============================================
when HTTP_RESPONSE {
set v_1_0 "\x8d\x90"
set v_1_...
hoolio
Cirrostratus
May 18, 2010Hi Den,
Here is an old post on a related issue with nulls in binary data. The fix there was to use binary format:
http://devcentral.f5.com/Forums/tabid/1082223/asg/50/showtab/groupforums/aff/5/aft/1253/afv/topic/Default.aspx
Unruley
Please try this out and let us know:
HTTP::payload replace offset 0 [binary format ca* 0 "my goofy string"]
FYI, the problem is that the literal string is converted to Utf-8 when Tcl compiles the rule. This changes any embedded NUL's to C0 80 in the string. Therefore, you still need to use the binary format command to convert from the Utf-8 encoded literal string into a binary array (this is what keeps HTTP::payload replace offset 0 "\000my goofy string" from working).
There is also a known issue with the binary format command that will prevent just using a* from working correctly (ie, binary format a* "\000my goofy string") This has been fixed in the upcoming 9.0.3 release.
Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects