Forum Discussion
HTTP:payload replace - problem with French characters
Ah, that makes more sense. The ACCESS::restrict_irule_events command is allowing you to see the access policy process in the HTTP event structure, and subsequently failing when you try to modify a response in the stream. Here's something, albeit crude, that should work. I've combined both iRules into one.
when CLIENT_ACCEPTED {
ACCESS::restrict_irule_events disable
}
when HTTP_REQUEST {
STREAM::disable
if { [HTTP::uri] ends_with "/my.logout.php3?errorcode=19" } {
HTTP::redirect "/"
} elseif { [HTTP::uri] contains "/public" } {
HTTP::header remove "Accept-Encoding"
if { [HTTP::version] eq "1.1" } {
if { [HTTP::header is_keepalive] } {
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
}
}
when ACCESS_ACL_ALLOWED {
set procstream 1
}
when HTTP_RESPONSE {
if { [info exists procstream] } {
if {[HTTP::header "Content-Type"] contains "text"} {
STREAM::expression {@flag:"true@flag:"false@}
STREAM::enable
}
}
}
It may require some tweaking, but the idea is to make sure the access policy evaluation is complete before attempting to rewrite the server's response. The ACCESS_ACL_ALLOWED event is only triggered on requests AFTER the policy is complete.
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