Forum Discussion
Shumer_84688
Nimbostratus
Jun 27, 2013iRule to calculate content-length of response using HTTP::collect and HTTP::payload
Here is a nice iRule to calculate content-length of response using HTTP::collect and HTTP::payload -
---- CUT BELOW ----
when HTTP_RESPONSE {
log local0. "HTTP_RESPONSE triggered"
HTTP::collect 32000000
set length [HTTP::payload length]
HTTP::header insert "Content-Length" $length
log local0. "the content length of the response from OWS is $length"
}
---- CUT ABOVE ----
PLEASE NOTE:
1) HTTP::collect may cause issues with Big-IP tmm when it is not limited to a specific size.
Please make sure you read this solution before setting this iRule : http://support.f5.com/kb/en-us/solutions/public/6000/500/sol6578.html
The iRule above is suitable to v11.x and above.
2) This is not an official F5 iRule. Use it at your own risk.
Shumer.
No RepliesBe the first to reply
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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