JEFF029
Jun 17, 2016Nimbostratus
[HTTP::payload] UTF-8 encoding issue
Hi,
I have an issue with [HTTP::collect]/[HTTP::payload] in my Irule.
I want to collect HTTP payload from client POST, then send it on another virtual server :
set Contenu [HTTP::payload]
set conn_id [connect -timeout 100 -idle 30 -status conn_status DESIRP4_TM01_J_i01]
set entete "POST /MetierTM01ws HTTP/1.1\r\nContent-Type: application/soap+xml;charset=UTF-8\r\nContent-Length: $content_length\r\nHost: X.X.X.X\r\nConnection: Keep-Alive\r\nUser-Agent: Apache-HttpClient/4.1.1 (java 1.5)\r\n\n"
set Fin "\r"
set Soapenvelope $Contenu$Fin
unset Fin
set data $entete$Soapenvelope
log local0. "04 Lancement connexion avec data : $data "
set send_bytes [send -timeout 1000 -status send_status $conn_id $data]
The client request is encoded in UTF-8, but it seems when I collect http payload, the F5 considers the content is in ascii and re-encodes it in UTF-8. For exemple the é (e acute) character (it is c3+a9 in UTF-8), after processing the character becomes a four-byte (c3+83+c2+a9).
Has anyone ever implemented this? If so could you share your iRule?
Many thanks,
JEFF