Forum Discussion
Misty_Spillers
Sep 29, 2011Nimbostratus
Https on a http site with stylesheets
Sorry I have searched and there seems like many similar questions but I can't find the one that fixes my issue. I'm far from an expert so sorry if this is newbie but I'm out of time to fix the issue ...
Michael_Yates
Sep 30, 2011Nimbostratus
I apologize for the delay. After you reported back that it did not work properly I tried it myself and could not get it to work either (I'm not giving up on it, but there is always more than one way to solve a problem).
I found the same example you posted and started to work with it. This is what i came up with that works.:
when HTTP_REQUEST {
Disable the stream filter for all requests
STREAM::disable
}
when HTTP_RESPONSE {
Check if response type is text
if {[HTTP::header value Content-Type] contains "text" } {
List the FQDN's that you do NOT want modified and the http:// that will cover everything else that you do.
STREAM::expression {@http://example.com@@ @http://example2.com@@ @http://@@}
Enable the stream filter for this response only
STREAM::enable
}
}
when STREAM_MATCHED {
Take the matches from the STREAM::expression and handle them.
if {[STREAM::match] contains "example.com" || [STREAM::match] contains "example2.com"} {
log local0. "Stream Matched: [STREAM::match]"
Return and do not alter them.
return
}
else {
STREAM::replace "[string map {http:// https://} [STREAM::match]]"
Everything not handled with get http:// replaced with https://
log local0. "Stream Matched ELSE: [STREAM::match]"
}
}
Hope this helps. If I find out why the original would not work then I'll post it here for everyone.
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