For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

FSC-IT_27241's avatar
FSC-IT_27241
Icon for Nimbostratus rankNimbostratus
Aug 28, 2013

irule use of http::uri leaves off url fragment, how to capture that information?

On the URI portion of a url in an irule how do I capture the fragment portion of the url?

 

Example:

 

http://site1.mysite.com/?sessid=NTAsU0ksMjAxMy0wOC0yOA==&path=help/spice_CSH.htmDC_Information/Customer_Tab.htm

 

Using HTTP::uri gets ?sessid=NTAsU0ksMjAxMy0wOC0yOA==&path=help/spice_CSH.htm

 

but leaves off the fragment DC_Information/Customer_Tab.htm and ideally I want that part to pass on with a redirection.

 

5 Replies

  • I don't believe that's the case (at least not in every version).

    when HTTP_REQUEST {
        log local0. [HTTP::uri]
    }
    

    Testing with cURL:

    curl "http://10.70.0.196/?sessid=NTAsU0ksMjAxMy0wOC0yOA==&path=help/spice_CSH.htmDC_Information/Customer_Tab.htm" 
    

    Log result:

       /?sessid=NTAsU0ksMjAxMy0wOC0yOA==&path=help/spice_CSH.htmDC_Information/Customer_Tab.htm
    

    Which LTM version are you running, and what does your iRule look like?

  • The fragment portion of the URL is a client-only feature that the browser uses to link to an anchor on the page. The value including, and past, the hash character is not passed by the browser to the server so the iRule won't see it. For more info, check out the wikipedia page on the topic:

     

    http://en.wikipedia.org/wiki/Fragment_identifier

     

    In particular, read the first paragraph in the "Basics" section.

     

    -Joe

     

  • Doh! Good point Joe. That's what I get for always testing with cURL.

     

    So to summarize, HTTP::uri would technically see the fragment, if the browser actually sent it. There are also many different uses for fragment identifiers, from simple anchor page movement to JavaScript/Ajax bookmarking. There are technically ways to get the fragment identifier, but it would help to understand WHY you need it.

     

  • You have answered my question in the sense that it does not appear that the browser sends the anchor tag information to the server as that is client side. SO, in a change of tactic, I guess I want to somehow capture that data as a parameter.

     

    The goal here is to forward the information to another web server that is doing some processing and analysis on the session id and then based on that sending the client to the appropriate page. So I need to pass that anchor tag information on to the other server to capture it as another query parameter seems like my next challenge.

     

  • Given that the browser WON'T send it, I think the only option is to push a client side script that will convert it to something the browser will send.