http payload
3 TopicsHTTP::Collect results in garbled HTTP::Payload when using non-english characters
Hi there, I'm using an irule to collect a POSTed payload, manipulate the content and then POST on to the back-end pool, however when non-english characters are used then the collected payload is garbled even before I start any processing: If I post for example: â ê î ô û á é í ó ú ü ñ I get the following in HTTP_REQUEST_DATA: â ê î ô û á é àó ú ü ñ I've looked through devcentral but the examples don't seem to relate to this or else they relate to the URI .. Is there a best-practice on how to correct this? Many thanks! when HTTP_REQUEST { HTTP::collect 1048576 } when HTTP_REQUEST_DATA { log local0. [HTTP::payload] }658Views0likes1Commentcapturing and appending to HTTP::payload in a POST to a SAML assertions consumer URL
I need to manipulate the HTTP body payload of a SAML post to an assertion consumer URL. If someone could point me in the right direction that would be great. I've tried layering a virtual server but that would mean i'd need to change the assertion consumer URL to a local virtual but this may not be the right approach. I can read the payload with HTTP::payload but not able to change the payload in transit. It basically needs to include the done parameter like in attached image:398Views0likes8Commentswhen HTTP_REQUEST_DATA not working
Hello folks, I have a POC I'm testing out. The idea is a web user does a HTTP POST with token that matches a value in a data group. If it matches it will connect them to the pool. I am running into trouble with HTTP_REQUEST_DATA not firing. I've done some debugging by placing log statements within my many IF clauses. Running LTM 11.5.1 HF4 when CLIENT_ACCEPTED { set usertoken "1" } end of CLIENT_ACCEPTED when HTTP_REQUEST_DATA { log local0. "HITTING http-request-data clause" foreach x [split [string tolower [HTTP::payload]] "&"] { if { $x starts_with "token=" } { set usertoken [lindex [split $x "="] 1] } } log local0. "User $usertoken attempted login from [IP::client_addr]:[TCP::client_port]" } end of HTTP_REQUEST_DATA when HTTP_REQUEST { set MasterToken [class match -value "num" equals data_POC ] if { ([IP::addr [IP::client_addr] equals "10.255.255.4/32"]) }{ Admin Page displayed based on source IP HTTP::respond 200 content "Token is $MasterToken" log local0. "HITTING 10.30.0.0 clause" } else { Check if request is a POST if { ([string tolower [HTTP::method]] eq "post" ) } { log local0. "HItting post clause" check content length is less than a 1Mb, or capture 1Mb only if { ([HTTP::header "Content-Length"] ne "") && ([HTTP::header "Content-Length"] <= 1048576)}{ log local0. "hitting content-length clause" set content_length [HTTP::header "Content-Length"] } else { set content_length 1048576 } Check if $content_length is not set to 0 if { $content_length > 0} { log local0. "HITTING http-collect clause" HTTP::collect this fires the HTTP_REQUEST_DATA event } Check if $gloabal_usertoken and $MAsterToken match if { ($usertoken eq $MasterToken) }{ MATCH page HTTP::respond 200 content " MATCH $usertoken and $MasterToken " } else { NO match page HTTP::respond 200 content " NO MATCH $usertoken and $MasterToken " } NO POST data } else { HTTP::respond 200 content [ifile get "iFile_TokenPage"] } } } end of HTTP_REQUEST usertoken = dynamic variable that gets set in HTTP_REQUEST_DATA based on the POST field=token and it's value, and read in HTTP_REQUEST where it is compared to the Data Group value. Interesting enough the client logic is making it to HTTP::collect Jun 10 17:09:01 deltm02 info tmm3[10524]: Rule /Common/irule_tokenPage : HItting post clause Jun 10 17:09:01 deltm02 info tmm3[10524]: Rule /Common/irule_tokenPage : hitting content-length clause Jun 10 17:09:01 deltm02 info tmm3[10524]: Rule /Common/irule_tokenPage : HITTING http-collect clause Jun 10 17:09:02 deltm02 info tmm3[10524]: Rule /Common/irule_tokenPage : HItting post clause Jun 10 17:09:02 deltm02 info tmm3[10524]: Rule /Common/irule_tokenPage : hitting content-length clause Jun 10 17:09:02 deltm02 info tmm3[10524]: Rule /Common/irule_tokenPage : HITTING http-collect clause Jun 10 17:09:03 deltm02 info tmm3[10524]: Rule /Common/irule_tokenPage : HItting post clause Jun 10 17:09:03 deltm02 info tmm3[10524]: Rule /Common/irule_tokenPage : hitting content-length clause Jun 10 17:09:03 deltm02 info tmm3[10524]: Rule /Common/irule_tokenPage : HITTING http-collect clause Jun 10 17:09:03 deltm02 info tmm3[10524]: Rule /Common/irule_tokenPage : HItting post clause Jun 10 17:09:03 deltm02 info tmm3[10524]: Rule /Common/irule_tokenPage : hitting content-length clause Jun 10 17:09:03 deltm02 info tmm3[10524]: Rule /Common/irule_tokenPage : HITTING http-collect clause Lastly here is the iFile_TokenPage just incase Any help would be greatly appreciated.272Views0likes1Comment