Forum Discussion
Strip 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
- MarvelNimbostratus
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" } }
- either of the below qualify to be Selected as Best answer? If so please do.
Cheers.
- rob_carrCirrocumulus
That rule won't load in v13.1, due to syntax errors.
Here's a version with corrected syntax:
when HTTP_REQUEST { if { [HTTP::header value "Origin"] starts_with "https://abc.com" } { HTTP::header remove "Origin" } }
I can't see any reason (off the top of my head) why this rule wouldn't be working (after syntax errors were removed). You might try logging the value of the Origin header to see what clients are actually offering, if you aren't seeing the expected outcome.
- CharlesCSCirrus
If you want to remove this header from the response, use the
event instead ofHTTP_RESPONSE
.HTTP_REQUEST
Recent Discussions
Related Content
* 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