Forum Discussion
HTTP to HTTPS stream correction
This iRule can cause with some application problems with loading images like PNG which contains inside content data HTTP string. To prevent problems with missing images - you should ensure that on the beginning of HTTP_RESPONSE you first disable STREAM profile and then enable it only for text content-type. iRule should look like this:
Exemple:
when HTTP_REQUEST {
STREAM::disable
HTTP::header remove "Accept-Encoding"
}
when HTTP_RESPONSE {
STREAM::disable
if { [HTTP::header exists Location] } {
HTTP::header replace Location [string map -nocase {"http://" "https://"} [HTTP::header Location]]
}
if {[HTTP::header value Content-Type] contains "text"}{
STREAM::expression {@http://@https://@}
STREAM::enable
}
}
}
"Artur Zdolinski" you are an absolute legend!!!
I was missing the STREAM::disable statement beneath the HTTP_RESPONSE and thus many images on our site were not loader properly (missing content-length headers etc). Adding this statement instantly fixed it. Thank you so much for sharing this
:)
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