Forum Discussion
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
- Kevin_Stewart
Employee
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.htmWhich 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
- Kevin_Stewart
Employee
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.
- FSC-IT_27241
Nimbostratus
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.
- Kevin_Stewart
Employee
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.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
