Forum Discussion
Issue with iRule for Stream of Chunked responses.
Hello, we're having an issue with an iRule that we have in place with the streaming of chunked responses. On certain pages of our site it causes there to be a connection issue. This is the rule currently. We've tried using the HTTP::collect method but that causes all characters to be rendered improperly, letters with accent's over top get garbled.
when RULE_INIT {
set static::debug_iRule-na_Generic-httpS_response_replace_443 1
}
when HTTP_REQUEST {
set request_uri [HTTP::uri]
set client_ipaddr [IP::client_addr]
HTTP::header remove Accept-Encoding
STREAM::disable
}
when HTTP_RESPONSE {
set vs_port [TCP::local_port]
if {[HTTP::header value Content-Type] contains "text/html"}{
STREAM::expression {@http://.*?:[0-9]+/@@}
STREAM::enable
} else {
STREAM::disable
}
}
when STREAM_MATCHED {
set replace_string ""
set matched_text [STREAM::match]
regsub -all {http://(.*)?:[0-9]+/} $matched_text {https://\1:443/} replace_string
regsub -all {http://(.*)?/} $replace_string {https://\1/} replace_string
if {${static::debug_iRule-na_Generic-httpS_response_replace_443}} {log local0.debug "\[--debug--\] VS_NAME=\[[virtual name]\]: source_string=\[$matched_text\] replacement_string=\[$replace_string\]"}
STREAM::replace $replace_string
}
Any information or suggestions are very appreciated.
1 Reply
Hi keving9012,
I've had some issues with STREAM and chunking in the past. The snippet below has help in my case. You may give it a try...
when HTTP_RESPONSE { if [HTTP::header exists "Transfer-encoding"] { HTTP::payload rechunk } }Cheers, Kai
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
