Forum Discussion
HTTP Response rewrite
I trying to modify text in the data portion of a packet but I'm not having success. The content-type does state text as one of the types, I have the default stream profile attached to the VIP. So I'm not sure if my code is incorrect or the F5 cannot read the response. I'm trying to change mywebsite.plate.com to abclabs.facts.net
If I should use something other than a stream profile tell me.
Client Request:
- POST /xi/ajax/whatever... HTTP/1.1
Server Response:
- HTTP/1.1 200 OK
- Content-Type: text/javascript;charset=UTF-8
- Strict-Transport-Security: max-age=16070400
- Cache-Control: no-store,no-cache
- Connection: keep-alive
- Transfer-Encoding: chunked
- dwr.engine._remoteHandleCallback('0','0',{baseUrl:"https://mywebsite.plate.com",msg:null,proxyFullName:null,success:true,url:"https://mywebsite.plate.com/learning/user/deeplink_redirect.jsp?linkId=HOME_PAGE&fromSF=Y"});
My code:
when HTTP_RESPONSE {
# Check if response type is text
if {[HTTP::header value Content-Type] contains "text"}{
# Replace mywebsite.plate.com with abclabs.facts.net
STREAM::expression "mywebsite.plate.com@abclabs.facts.net@"
# Enable the stream filter for this response only
STREAM::enable
}
}
- ottleydamianCirrus
Solved: the example I looked at was wrong, the syntax is
STREAM::expression {@corning03.plateau.com@kdlabs.corningtest.net@}
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