SteelApp Forum

Reply
Highlighted
Occasional Contributor
Posts: 8
Registered: ‎11-04-2013

Traffic Script - Change a POST url?

Hi

I am new to Riverbed Traffic Scripts.  What i need to do is change the post URL that someone is trying to POST to.  I am probably not explaining it correctly.

When the customer does a GET from our web server the packet capture shows just the query string:

GET /Test_Page/Testing_Page_ID.aspx?trx_id=DFT12345678901234567890&token=8zxc4v85bnmas3005216

But when i see the POST (they are going to post some XML.  I am seeing the following:

POST http://10.10.10.8:8000/Test_Page/Testing_Page_ID.aspx

We are then returning a 404 (not that i can see this on the IIS server logs, so i am guessing the STM is returning it, but i might be wrong?

Is there a way using a traffic script to remove the first part of it and just use the query string to fo the POST?

Thanks in advance for your help

Martin

Contributor
Posts: 22
Registered: ‎05-21-2013

Re: Traffic Script - Change a POST url?

Hi Martin,

You might want to take a look at these examples : HowTo: Inspect HTTP request parameters

Specifically these variables :


$rawurl    = http.getRawURL();      # returns '/search?hl=en&q=ZXTM&btnG=Google+Search'


$path        = http.getPath();        # returns '/search'


$querystr = http.getQueryString();  # returns 'hl=en&q=ZXTM&btnG=Google+Search'


Best regards

Bjarke

Occasional Contributor
Posts: 8
Registered: ‎11-04-2013

Re: Traffic Script - Change a POST url?

Hi Bjarke,

Thank you for your response it helped me come up with the following script to fix the problem:

--------------------------------------------------------------------

#Telkomsel_POST_Fixup

$url = http.getRawURL();

# Rewrite Path to remove the IP Address

if( string.contains( $url , "10.10.10.8" ) ||

    string.contains( $url , "10.10.10.9" )

) {

   http.setPath( "Test_Page/Testing_Page_ID.aspx" );

--------------------------------------------------------------------

Thanks again

Martin

Join the Community

Get quick and easy access to valuable resource designed to help you manage your Brocade Network.