Forum Discussion
Craig_Jackson_1
Nimbostratus
May 22, 2006Responding with binary image
I'm trying to implement a "goaway" capability. It seems like it should be possible to implement it totally in the Bigip. Basically, I need to respond to all URLs with an HTML page saying "come back later". But they want a logo on the page.
I've got an iRule that looks like this:
when HTTP_REQUEST {
set content [b64decode "base 64 encoded PNG"]
HTTP::Respond 200 content $content "Content-Type" "image/png"
}
But it only sends the PNG up until the first null character, which is about 7 bytes. I also tried to add a content-length header using [string length $content], and also got a value of 7.
Is there any way to deal with binary data like this in iRules? HTTP::Payload replace perhaps?
Craig Jackson
Craig.Jackson@thomson.com
- Craig_Jackson_1
Nimbostratus
I know my full rule will need to include the html. What I expect to code is: - bl0ndie_127134Historic F5 AccountCraig you are not doing any thing wrong, but instead I think you might be running into some Encoding issues we have seen with TCL. If you open a case with support we will try to get it figured out.
- Craig_Jackson_1
Nimbostratus
Thanks. It looks like TCP::Respond works where HTTP::Respond fails, when null bytes are an issue. - dennypayne
Employee
Thread resurrection: :-)
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