Forum Discussion
Jeff_Goot_42327
Apr 26, 2012Nimbostratus
STREAM::expression Not Replacing All Occurrences
I'm trying to track down an issue with an iRule that uses STREAM::expression. It's able to replace the occurrences of the string, but not all of the occurrences.
Here's ...
Ken_Nowell_6806
Jan 07, 2013Nimbostratus
I seem to be experiencing the same issue. Has anyone identified a solution? Here's a copy of my iRule. I can also provide the original and modified responses if need be.
when HTTP_REQUEST {
Explicitly disable the stream profile for each request so it doesn't stay
enabled for subsequent HTTP requests on the same TCP connection.
STREAM::disable
}
when HTTP_RESPONSE {
Apply stream profile against text or javascript responses from the application
if { [HTTP::header value Content-Type] contains "text" || [HTTP::header value Content-Type] contains "javascript" }{
Replace /webcenter/spaces/MortgageCenter/page/ with /MortgageCenter/page/
Replace /webcenter/oracle/webcenter/siteresources/scopedMD/ with /MortgageCenter/siteresources/scopedMD/
Replace /webcenter/faces/oracle/webcenter/page/scopedMD/ with /MortgageCenter/page/scopedMD/
Replace /webcenter/faces/ with /MortgageCenter/faces/
Replace /webcenter/adf/ with /MortgageCenter/adf/
Replace /webcenter/afr/with /MortgageCenter/afr/
Replace /webcenter/sessioninvalidation with /MortgageCenter/sessioninvalidation
Replace /webcenter/oracle/webcenter/webcenterapp/view/templates/publichtml/ with /MortgageCenter/publichtml/
STREAM::expression {@/webcenter/spaces/MortgageCenter/page/@/MortgageCenter/page/@ @/webcenter/oracle/webcenter/siteresources/scopedMD/@/MortgageCenter/siteresources/scopedMD/@ @/webcenter/faces/oracle/webcenter/page/scopedMD/@/MortgageCenter/page/scopedMD/@ @/webcenter/faces/@/MortgageCenter/faces/@ @/webcenter/adf/@/MortgageCenter/adf/@ @/webcenter/afr/@/MortgageCenter/afr/@ @/webcenter/sessioninvalidation@/MortgageCenter/sessioninvalidation@ @/webcenter/oracle/webcenter/webcenterapp/view/templates/publichtml/@/MortgageCenter/publichtml/@}
Enable the stream profile
STREAM::enable
}
If the response contains the Set-Cookie header, rewrite the context root
if { [HTTP::header value Set-Cookie] contains "/webcenter" }{
HTTP::header replace Set-Cookie [string map "/webcenter /" [HTTP::header value Set-Cookie]]
}
If the response is a redirect rewrite the Location header.
Replace /webcenter/spaces/MortgageCenter/page/ with /MortgageCenter/page/
Replace /webcenter/oracle/webcenter/siteresources/scopedMD/ with /MortgageCenter/siteresources/scopedMD/
Replace /webcenter/faces/oracle/webcenter/page/scopedMD/ with /MortgageCenter/page/scopedMD/
Replace /webcenter/faces/ with /MortgageCenter/faces/
Replace /webcenter/adf/ with /MortgageCenter/adf/
Replace /webcenter/afr/ with /MortgageCenter/afr/
Replace /webcenter/sessioninvalidation with /MortgageCenter/sessioninvalidation
Replace /webcenter/oracle/webcenter/webcenterapp/view/templates/publichtml/ with /MortgageCenter/publichtml/
if { [HTTP::is_redirect] }{
HTTP::header replace Location [string map "/webcenter/spaces/MortgageCenter/page/ /MortgageCenter/page/ /webcenter/oracle/webcenter/siteresources/scopedMD/ /MortgageCenter/siteresources/scopedMD/ /webcenter/faces/oracle/webcenter/page/scopedMD/ /MortgageCenter/page/scopedMD/ /webcenter/faces/ /MortgageCenter/faces/ /webcenter/adf/ /MortgageCenter/adf/ /webcenter/afr/ /MortgageCenter/afr/ /webcenter/sessioninvalidation /MortgageCenter/sessioninvalidation /webcenter/oracle/webcenter/webcenterapp/view/templates/publichtml/ /MortgageCenter/publichtml/" [HTTP::header value Location]]
}
}
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