Forum Discussion

Thiyagu_343098's avatar
Thiyagu_343098
Icon for Nimbostratus rankNimbostratus
Jan 21, 2018

understanding of the irule script

Hello all, Hope you all are enjoying the weekend. Could you please help me to know what the below two irule does with the data flow?

 

=============================1============================== when HTTP_REQUEST { set rd "%[ROUTE::domain]" set client_ip [string map "$rd \"\"" [IP::client_addr]] HTTP::header insert srcaddr $client_ip }

 

=======================2============================== when HTTP_REQUEST { set uri [HTTP::uri] if { ! ( $uri ends_with "/" ) } { append uri "/" HTTP::uri $uri } } Regards, Thiyagu

 

  • First code, inserts client IP address in HTTP header and second one appends "/" if URI does not end with "/".