Forum Discussion
Jason_G__141424
Jan 05, 2015Nimbostratus
Removing HTTP headers within an HTTP::respond
Quick question on how to remove items from the HTTP header while doing an HTTP:respond within an iRule. I currently have the following HTTP:respond.
HTTP::respond 200 content $static::blockpage...
nitass
Jan 06, 2015Employee
what about something like this?
configuration
[root@ve11a:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when RULE_INIT {
set static::blockpage "hello world\r\n"
set static::len [string length $static::blockpage]
}
when HTTP_REQUEST {
TCP::respond "HTTP/1.0 200 OK\r\nCache-Control: private\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: ${static::len}\r\n\r\n$static::blockpage"
}
}
test
[root@ve11a:Active:In Sync] config curl -i http://172.28.24.10
HTTP/1.0 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 13
hello world
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