Forum Discussion
KBerger_52392
Nimbostratus
Jun 18, 2010Repacing http://*** references in payload
Hi all,
I'm very new to using iRules, so please don't smack me down, if I get anything wrong üòâ
I am working as a software-developer. We have an application which is being accessed via a BigIP over HTTPS. It does the HTTPS-Offload and communicates via HTTP with the underlying nodes. The problem is, that there is one component within the software which will return an absolute address within it's response. As the application relies on its HTTP-Context, it does not know that it can only be accessed via HTTPS, since the Loadbalancer actually connects via HTTP.
So what I wanted to do was to implement an iRule which scans the response-payload of the application-servers and replaces the by using regular expressions for instance. I think I got the rule as i want it to have, but I get a runtime error which tells me, that HTTP::collect is not valid in the current scopy (whatever).
So here comes the rule:
when HTTP_RESPONSE
{
Get the content length so we can request the data to be
processed in the HTTP_RESPONSE_DATA event.
if { [HTTP::header exists "Content-Length"] && [HTTP::header "Content-Length"] < 1048577 }
{
set content_length [HTTP::header "Content-Length"]
}
else
{
set content_length 1048576
}
if { $content_length > 0 }
{
HTTP::collect $content_length
}
}
The actual action happens in HTTP_RESPONSE_DATA, but the error occurs above.
Does anyone have any ideas about why this script fails?
Is there a better way to achieve what I need to have?
Best regards and thanks in advance
Kristof
- hoolio
Cirrostratus
Hi,
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects