Forum Discussion
Marvel
Nimbostratus
Apr 25, 2019Strip http origin header
Can anyone please provide me the iRule to strip the “origin” header from http response
I used an iRule to remove but it is removing it from the response but I need it deleted from the request ...
This is the iRule that I am using right now:
when HTTP_REQUEST { if { [HTTP::header value "Origin"] starts_with "; } then { HTTP::header remove "Origin" } }
LiefZimmerman
Admin
Jan 30, 2020- either of the below qualify to be Selected as Best answer? If so please do.
Cheers.
- Hi Joe,
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { /uri1* - /uri2* { set check_response 0 snatpool SNAT_DMZ pool pool_www.mysite.org_URI1 } /testlink* { snatpool SNAT_APZ set check_response 1 pool pool_www.mysite.org_TESTLINK } } } when HTTP_RESPONSE { if {$check_response} { STREAM::expression "@http://www.mysite.org@https://www.mysite.org@" STREAM::enable } else { STREAM::disable } }
- Moe_JartinFeb 08, 2010
Cirrus
Aaron,switch $check_response { 1 { STREAM::expression "@http://host1@https://host1@" STREAM::enable } 2 { STREAM::expression "@http://host2@https://host2@" STREAM::enable } 3 { STREAM::expression "@http://host3@https://host3@" STREAM::enable } default { STREAM::disable } }
- Hi Joe,
when HTTP_REQUEST { Unset the stream_expr variable if it exists already if {[info exists stream_expr]}{ unset stream_expr } Check the requested URI switch -glob [string tolower [HTTP::uri]] { /uri1* - /uri2* { set stream_expr "@http://www.mysite.org@https://www.mysite.org@" snatpool SNAT_DMZ pool pool_www.mysite.org_URI1 } /uri3* - /uri4* { set stream_expr "@http://www.mysite4.org@https://www.mysite4.org@" snatpool SNAT_DMZ pool pool_www.mysite.org_URI4 } /uri5* - /uri6* { snatpool SNAT_DMZ pool pool_www.mysite.org_URI4 } /testlink* { set stream_expr "@http://www.mysite.test.org@https://www.mysite.test.org@" snatpool SNAT_APZ pool pool_www.mysite.org_TESTLINK } } } when HTTP_RESPONSE { if {[info exists stream_expr]} { STREAM::expression $stream_expr STREAM::enable } else { STREAM::disable } }
- Moe_JartinFeb 08, 2010
Cirrus
Beautiful!! Does that qualify as a Nerd Alert if I think an iRule is beautiful?? Thanks a ton!
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