Forum Discussion
ramann_75062
Nimbostratus
Apr 08, 2010Replace a header value with stream
hi@all,
i try to replace a part of a header value with STREAM
In the response, i get a 302 back. in this 302er I want to replace the protocol.
Example:
Location: ht...
A stream profile is only applied against the payload. So if you have a TCP VIP, a stream profile would apply against the TCP payload. The TCP payload could be made up of HTTP headers and an HTTP payload. If you add an HTTP profile to the VIP, then the stream profile is only applied to the HTTP payload.
To rewrite the Location header in redirects from http:// to https:// you could create a custom HTTP profile with Rewrite Redirects enabled. Or if you want to do this in an iRule you could use something like this:
when HTTP_RESPONSE {
Rewrite the Location header for redirects from http:// to https://
if {[HTTP::is_redirect]}{
HTTP::header replace Location [string map -nocase "http:// https://" [HTTP::header Location]]
}
}
Aaron
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