Forum Discussion
mulot
Feb 09, 2011Nimbostratus
Modify UTF-8 strings in Payload
Hi I would like to replace some strings in HTTP payload but strings are in UTF-8 format (header "Content-Type: text/html; charset=utf-8" in server response). My irule is : ...
hooleylist
Feb 09, 2011Cirrostratus
As a test, can you try using regsub instead of string map?
http://www.tcl.tk/man/tcl8.4/TclCmd/regsub.htm
Also, you can simplify the collection size logic a bit and make sure you avoid collecting more than 1Mb of payload by modifying your HTTP_RESPONSE code:
when HTTP_RESPONSE {
if {[HTTP::header value Content-Type] contains "text"} {
if { [HTTP::header exists "Content-Length"] and [HTTP::header "Content-Length"] < 1048575 } {
set content_length [HTTP::header "Content-Length"]
} else {
set content_length 1048576
}
if { $content_length > 0 } {
HTTP::collect $content_length
}
}
}
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