Forum Discussion
Irule applied stream profile and URLs in comments - any thoughts?
Here is the general form of the irule:
when HTTP_RESPONSE {
if { [HTTP::header Content-Type] starts_with "text/" }{
STREAM::expression
"@http:\u002f\u002fstuff.corp.net@https:\\u002f\\u002f
stuff.corp.net@"
STREAM::enable
log local0. "Streaming enabled for [HTTP::host]"
} else {
STREAM::disable
log local0. "Streaming NOT enabled for [HTTP::host]"
}
}
It works just fine for standard HTTP http to https stream translations, however when faced with a URL within a comment, it does not work, for example:
Are escaped text parts of an HTTP stream 'valid' to a stream profile? Thanks in advance for your thoughts.
17 Replies
- hoolio
Cirrostratus
I'm out of ideas. If you do end up opening a support case on this, can you reply with the result? - brad_11480
Nimbostratus
haven't seen any updates here and i see this thread is a bit dated. - hoolio
Cirrostratus
Hi Brad, - Reddy_Gurram_95
Nimbostratus
This works for us...: - hoolio
Cirrostratus
Hi Reddy,
You should actually be able to skip the STREAM_MATCHED code as you're already setting the find/replace string in the STREAM::expression command.
Also, someone else recently pointed out that it is more complete to disable the stream filter on each request (in HTTP_REQUEST) than on every response. Using the original method, the stream filter would be left enabled for a subsequent request. ie, if there was a text response which enabled the stream filter, the stream filter would be left enabled on the subsequent HTTP request on the same TCP connection.
Can you try this instead?
when HTTP_REQUEST { Disable the stream filter by default STREAM::disable } when HTTP_RESPONSE { Check if response type is text if {[HTTP::header value Content-Type] contains "text"}{ STREAM::expression {@http://www.example.com@https://www.example.com@} Enable the stream filter for this response only STREAM::enable } }
Aaron
- Simon_Blakely
Employee
Just to provide a definitive answer to this issue
STREAM::expression {@http:\\u002f\\u002fsite.net@https:\u002f\u002fsite.net@}
works for these address specifiers.
Note that you must use { and } to delimit the expression string (otherwise the escaping does not work correctly).
Alternatively, you can use
STREAM::expression "@http:\\\\u002f\\\\u002fsite.net@https:\\u002f\\u002fsite.net@"
- Damon_Kalajzich
Nimbostratus
I was having a similar issue and finally got it working with the following
set oldstring "http:\\u002f\\u002fINTERNALSITE"
set newstring "https:\u002f\u002fEXTERNALSITE"
STREAM::expression "@$oldstring@$newstring@"
STREAM::enable
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