Forum Discussion
dirken
May 02, 2012Nimbostratus
remove tcp port from Location header in redirect
Hi folks, newbie and tasked to remove the tcp port from a redirect's Location header. Without a test system I cannot check it and would appreciate any feedback before going live. Would this iRule work?
when HTTP_RESPONSE {
if { [HTTP::is_redirect] } {
[string map [list :52600 ""] [HTTP::header Location]]
}
}
- MiLK_MaNNimbostratusTry:
- dirkenNimbostratusTwo problems:
- MiLK_MaNNimbostratus
You are right. Apologies for not considering that.
when HTTP_RESPONSE {
if { [HTTP::is_redirect] } {
regsub -all ":52600" [HTTP::header Location] "" newlocation
HTTP::header replace Location $newlocation
}
}
- hoolioCirrostratusYou could use string commands for this as well. Here are a few options which should be a bit more efficient than regsub:
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